Skip to content

Marko

Marko scores 11 of 28 points. That is 4 of 14 on the 7 features that affect first paint (the moment the browser first draws content), and 7 of 14 on the 7 other features.

Rank 20 of 2311/28 points: 4/14 first-paint, 7/14 other · 39% complete
Version checked
marko 6.5.1, @marko/run 0.11.19 (pre-1.0), @marko/vite 6.1.14 (npm latest); the marko-books port resolves marko 6.4.15 / @marko/run 0.11.17 / @marko/vite 6.1.14
Performance guide
Why is Marko Fast? | MarkoExplanation page, not a tuning guide; closest official page.
Issues
github.com/marko-js/marko/issues

Scorecard

All 14 features, in two groups. Each row shows Marko's label, how that label compares across all 23 frameworks, and how to enable the feature. Feature names link to Marko's entry on that feature's page.

Marko's labels across 14 features

  • 1st-party4
  • Experimental0
  • Third-party3
  • Manual7
  • of 14

How it compares

On 4 of 14 features, no framework has a higher-scoring label than Marko. On the other 10, at least one does.

Tested in our port

The marko-books port passes 11/11 feature tests. Run on 2026-11-26 at MaxwellCohen/marko-books@4f62360. How we test labels

First-paint levers

4/14
  • Manual, like 11 of the other 22 frameworks. 11 frameworks score higher.

    Show the how-to

    <style> is bundled and loaded once; no inlining option documented (Vite ?inline would be by hand). No first-party CSS inlining documented. (styling)

    Code example

    You replace the layout's side-effect CSS import with a Vite ?inline import, then write it out with <html-style>. The port uses the same $!{…} form for its theme script in <html-script>.

    // src/routes/+layout.marko
    import css from "../styles.css?inline"   // was: import "../styles.css"
    
    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        // emitted as a literal <style> in the streamed HTML; no stylesheet <link>
        <html-style>$!{css}</html-style>
        // …
      </head>
      <body>
        <${input.content}/>
      </body>
    </html>

    Source: Vite: disabling CSS injection

  • 02Font optimizationThird-party1 pt

    Third-party, like 18 of the other 22 frameworks. 4 frameworks score higher.

    Show the how-to

    No font primitive documented; self-host by hand with a community package such as Fontsource (as the marko-books optimized branch does). The Core Tags reference only shows a Google Fonts @import inside <html-style> (a raw <style> tag). No first-party font handling documented. (core-tag, styling)

    Code example

    The Books port self-hosts Geist with Fontsource. The CSS @import pulls the package's @font-face rules, and Vite copies the .woff2 files into the build with hashed names.

    /* src/styles/global.css */
    @import '@fontsource-variable/geist';
    @import '@fontsource-variable/geist-mono';
    @import 'tailwindcss';
    
    @theme {
      --font-sans: 'Geist Variable', ui-sans-serif, system-ui, sans-serif;
      --font-mono: 'Geist Mono Variable', ui-monospace, monospace;
    }

    Source: Fontsource: Install

  • 03Image pipelineThird-party1 pt

    Third-party, like 13 of the other 22 frameworks. 9 frameworks score higher.

    Show the how-to

    No image component or optimizer documented; the native-tag page and the full reference contain only an og:image meta example and plain <img>. @marko/vite rewrites static relative <img src> paths to hashed Vite assets but does not resize or convert. A host image CDN wired by hand is the third-party route, as for React Router and Ember. (native-tag)

    Code example

    Marko has no image component, so a small tag builds a srcset against the host's image CDN. This one uses Netlify Image CDN URLs; remote sources must be allowlisted in netlify.toml.

    // src/tags/book-cover.marko
    export interface Input { src: string; title: string; sizes: string; priority?: boolean }
    
    static const WIDTHS = [160, 320, 640];
    static function cdn(src: string, w: number) {
      return `/.netlify/images?url=${encodeURIComponent(src)}&w=${w}&q=75`;
    }
    
    <img
      src=cdn(input.src, 320)
      srcset=WIDTHS.map((w) => `${cdn(input.src, w)} ${w}w`).join(", ")
      sizes=input.sizes
      alt=input.title
      width=320 height=480
      loading=(input.priority ? "eager" : "lazy")
      fetchpriority=(input.priority ? "high" : undefined)
    />
    # netlify.toml
    [images]
      remote_images = ['https://images\.gr-assets\.com/.*']

    Source: Netlify: Image CDN overview

    Art direction with <picture>

    Manual

    Serving a different crop or format per screen size. Not scored: the label shows how much the framework does for you.

    All native HTML tags are supported, so <picture> is hand-written. No first-party image helper documented on the native-tag page or in the full reference. (native-tag)

    Example

    Marko renders native tags as-is, so you write <picture> in a custom tag. You also produce each format and crop yourself and put them in public/.

    // src/tags/hero-image.marko
    export interface Input {
      alt: string;
      priority?: boolean;
    }
    
    <picture>
      <source media="(min-width: 1000px)" type="image/avif" srcset="/hero-wide.avif">
      <source media="(min-width: 1000px)" srcset="/hero-wide.jpg">
      <source type="image/avif" srcset="/hero-tall.avif">
      <img
        src="/hero-tall.jpg"
        alt=input.alt
        width=750
        height=1334
        decoding="async"
        fetchpriority=(input.priority ? "high" : undefined)
        loading=(input.priority ? "eager" : "lazy")
      >
    </picture>

    Source: Marko native tags

  • Manual, like 4 of the other 22 frameworks. 18 frameworks score higher.

    Show the how-to

    Marko Run documents no data cache, ISR, or cache-header API. @marko/run-adapter-static builds the whole app into static files by crawling relative links (urls option for extras), with no revalidation and no per-route choice, so it does not cache a server-rendered app. Otherwise the app hand-sets Cache-Control on web-standard Request/Response, the same basis as Fresh. Our feature test passed only by setting Cache-Control by hand in the route's GET handler. (adapters)

    Code example

    For a fully static site, swap in @marko/run-adapter-static, which crawls links at build time; urls adds pages the crawler can't reach. For server-rendered pages, set Cache-Control yourself in middleware, as the Books port does.

    // vite.config.ts (static build)
    import { defineConfig } from "vite";
    import marko from "@marko/run/vite";
    import staticAdapter from "@marko/run-adapter-static";
    
    export default defineConfig({
      plugins: [marko({ adapter: staticAdapter({ urls: ["/about", "/1"] }) })],
    });
    // src/routes/+middleware.ts (server build)
    export default async (_ctx: unknown, next: () => Promise<Response>) => {
      const response = await next();
      if (!response.headers.get("content-type")?.includes("text/html")) return response;
      const headers = new Headers(response.headers);
      headers.set("Cache-Control", "public, max-age=0, must-revalidate");
      return new Response(response.body, { status: response.status, headers });
    };

    Source: Marko Run: Adapters

  • Manual, like 2 of the other 22 frameworks. 20 frameworks score higher.

    Show the how-to

    No prefetch/preload API in the Marko Run docs or full reference. Lazy load triggers (visible, idle, media, events) defer a tag's JS only; that is not route prefetch. (lazy-loading)

    Code example

    Marko Run navigates with full documents, so a Speculation Rules block in the layout handles it. Supporting browsers prefetch same-origin links on hover; the others ignore the block.

    // src/routes/+layout.marko
    <head>
      // …
      <html-script type="speculationrules">
        {
          "prefetch": [{
            "where": { "and": [
              { "href_matches": "/*" },
              { "not": { "selector_matches": "[rel~=nofollow]" } }
            ]},
            "eagerness": "moderate"
          }]
        }
      </html-script>
    </head>

    Source: MDN: speculationrules

  • 06Streaming SSR1st-party2 pts

    1st-party, like 17 of the other 22 frameworks. None scores higher.

    Show the how-to

    Streaming is the default. Marko flushes HTML up to each <await> and sends the rest when its promise resolves; a <try> with @placeholder opts into out-of-order streaming and shows the placeholder first. (streaming)

    Code example

    The handler passes the queries to the page as unresolved promises. Each <await> sits in a <try> with @placeholder, so the skeleton is sent first and the grid streams in when its promise resolves.

    // src/routes/+handler.ts
    export const GET = Run.GET((ctx, next) => {
      const params = parseSearchParams(ctx.search ?? {});
      return next({
        books: loadBooksPage(params),   // not awaited
        count: loadBooksCount(params),  // not awaited
      });
    });
    // src/routes/+page.marko
    <try>
      <await|books|=$global.data.books>
        <book-grid books=books/>
      </await>
      <@placeholder><book-grid-skeleton/></@placeholder>
      <@catch|err|><error-state title="Can't load books" body=err.message/></@catch>
    </try>

    Source: Marko: Streaming

  • Manual, like 15 of the other 22 frameworks. 7 frameworks score higher.

    Show the how-to

    No first-party preload Link headers or 103 Early Hints documented. Handlers return web-standard Response objects, so a Link header is set by hand in a +handler or +middleware file. (file-based-routing)

    Code example

    Set a Link header on HTML responses in the root middleware. This one preconnects to the font host. To preload a built file with a hashed name, read its URL from the Vite manifest.

    // src/routes/+middleware.ts
    const LINK = '<https://fonts.gstatic.com>; rel=preconnect; crossorigin';
    
    export default async (_ctx: unknown, next: () => Promise<Response>) => {
      const response = await next();
      if (response.headers.get('content-type')?.includes('text/html')) response.headers.append('Link', LINK);
      return response;
    };

    Source: Marko Run: file-based routing

Other features

7/14
  • 1st-party, like 14 of the other 22 frameworks. None scores higher.

    Show the how-to

    Zero JS by default; the compiler ships only interactive code and the client resumes instead of re-running templates; import X from "<tag>" with { load: "visible#hero" } defers a tag bundle. The docs describe an islands-like result without a server/client component split. (fine-grained-bundling, why-is-marko-fast, lazy-loading)

    Code example

    Interactive code ships by default only for tags with client state or handlers. To delay one tag's JS further, import it with a load trigger. The server still renders its HTML; the browser fetches the bundle when #reviews scrolls into view.

    // src/routes/$id/+page.marko
    import BookReviews from "<book-reviews>" with { load: "visible#reviews?rootMargin=200px" }
    
    <book-detail book=$global.data.book/>
    
    <section id="reviews">
      <BookReviews bookId=$global.data.book.id/>
    </section>

    Source: Marko: Lazy loading

  • Manual, like 3 of the other 22 frameworks. 19 frameworks score higher.

    Show the how-to

    Marko Run documents streaming SSR; the static adapter is app-wide and +meta.* is static metadata only. No per-route render-mode switch documented. (file-based-routing, adapters)

    Code example

    Every route still streams SSR. You tag a route with a mode in +meta.json, and the root middleware turns it into CDN Cache-Control. This adapts the port's +middleware.ts.

    // src/routes/about/+meta.json   →  { "render": "static" }
    // src/routes/+meta.json         →  { "render": "isr" }
    
    // src/routes/+middleware.ts
    const cacheControl: Record<string, string> = {
      static: "public, s-maxage=31536000",                // cached until redeploy
      isr: "public, s-maxage=60, stale-while-revalidate=86400",
    };
    
    export default Run.ALL(async (ctx, next) => {
      const res = await next();
      if (!res.headers.get("content-type")?.includes("text/html")) return res;
      const mode = (ctx.meta as { render?: string } | undefined)?.render;
      const headers = new Headers(res.headers);
      headers.set("Cache-Control", cacheControl[mode ?? ""] ?? "private, no-store"); // SSR
      return new Response(res.body, { status: res.status, statusText: res.statusText, headers });
    });

    Source: Marko Run file-based routing (+meta, +middleware)

  • 1st-party, like 21 of the other 22 frameworks. None scores higher.

    Show the how-to

    The compiler resolves reactivity per expression; "no dependency tracking happens at runtime"; <let> / <const>. (why-is-marko-fast)

    Code example

    <let> declares state and <const> derives from it. The compiler works out which DOM nodes depend on count at build time, so there is no runtime dependency tracking.

    // src/tags/counter.marko
    <let/count=0>
    <const/doubled=count * 2>
    
    <button onClick() { count++ }>
      ${count} × 2 = ${doubled}
    </button>

    Source: Marko: Why is Marko fast

  • Third-party, like 18 of the other 22 frameworks. 2 frameworks score higher.

    Show the how-to

    The CLI has only dev, build, preview; the Vite plugin options are routesDir, adapter, trailingSlashes. No first-party analyzer documented; Marko Run builds with Vite, so the third-party route is a community visualizer such as rollup-plugin-visualizer. (cli, vite-plugin)

    Code example

    Marko Run builds with Vite, so add rollup-plugin-visualizer next to the Marko plugin. marko-run build then writes a treemap of the client bundles.

    // vite.config.ts
    import { defineConfig } from "vite";
    import marko from "@marko/run/vite";
    import { visualizer } from "rollup-plugin-visualizer";
    
    export default defineConfig({
      plugins: [
        marko(),
        visualizer({ filename: "stats.html", gzipSize: true, brotliSize: true }),
      ],
    });

    Source: rollup-plugin-visualizer README

  • Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.

    Show the how-to

    <script> is effect-like, not a loader; <html-script> emits a raw tag. No loading strategies documented. (core-tag)

    Code example

    Marko's <script> is a mount effect, so you use <html-script> for a literal async tag. A <script> effect then loads the low-priority widget at browser idle.

    // src/routes/+layout.marko
    <head>
      // …
      // literal tag in the HTML: downloads in parallel, never blocks parsing
      <html-script async src="https://analytics.example.com/script.js"></html-script>
    </head>
    <body>
      <${input.content}/>
      // runs once in the browser after mount, then waits for idle
      <script>
        (window.requestIdleCallback || setTimeout)(() => {
          const s = document.createElement("script");
          s.src = "https://widget.example.com/chat.js";
          s.async = true;
          document.head.append(s);
        });
      </script>
    </body>

    Source: Marko core tags

  • 1st-party, like 7 of the other 22 frameworks. None scores higher.

    Show the how-to

    Official adapters for Node, Static and Netlify (Functions or Edge, needs netlify.toml) are on the adapters page. Cloudflare Workers (@marko/run-adapter-cloudflare) is announced as an official adapter in the markojs.com October 2026 newsletter but is not yet on the adapters page. @marko/run-adapter-vercel (npm 0.1.1) is published from the marko-js/run repository by the same maintainers as @marko/run and is documented only in its repo README, not on markojs.com. None is labeled experimental. The marko-books port deploys with all three. (adapters)

    Code example

    The Books port picks an adapter at build time from an env var. The default Node adapter covers local and container runs; the Netlify, Vercel and Cloudflare adapters build for each host.

    // vite.config.ts
    import { defineConfig } from "vite";
    import marko from "@marko/run/vite";
    
    export default defineConfig(async () => {
      const adapter = process.env.CLOUDFLARE
        ? (await import("@marko/run-adapter-cloudflare")).default()
        : process.env.NETLIFY
          ? (await import("@marko/run-adapter-netlify")).default() // { edge: true } for Edge Functions
          : process.env.VERCEL
            ? (await import("@marko/run-adapter-vercel")).default()
            : (await import("@marko/run/adapter")).default();
    
      return { plugins: [marko({ adapter })] };
    });
    NETLIFY=1 marko-run build && netlify deploy --prod --no-build

    Source: Marko Run: Adapters

  • Manual, like 16 of the other 22 frameworks. 6 frameworks score higher.

    Show the how-to

    No service worker support documented in the Marko or Marko Run docs. Hand-write the worker, serve it as a static file, and register it from a <script>. (file-based-routing)

    Code example

    Put a hand-written worker in public/ and register it with an inline script in the root layout.

    // public/sw.js
    const CACHE = 'books-v1'; // change the name on each deploy
    
    self.addEventListener('activate', (event) => {
      event.waitUntil(
        caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
      );
    });
    
    self.addEventListener('fetch', (event) => {
      const { request } = event;
      if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return;
      // Network first, so pages stay current. The cached copy answers when offline.
      event.respondWith(
        fetch(request)
          .then((response) => {
            const copy = response.clone();
            caches.open(CACHE).then((cache) => cache.put(request, copy));
            return response;
          })
          .catch(() => caches.match(request)),
      );
    });
    // src/routes/+layout.marko
    static const SW_SCRIPT = `if('serviceWorker' in navigator)addEventListener('load',function(){navigator.serviceWorker.register('/sw.js')});`;
    // … in <head>
        <html-script>$!{SW_SCRIPT}</html-script>

    Source: Using Service Workers (MDN)

1st-party scores 2 points, Experimental and Third-party 1, Manual 0. How scoring works

The port

The books demo app built with this framework, and where each branch is deployed.

Latest benchmark

Mobile Lighthouse lab results from PageSpeed Insights on : the median of 3 runs per host, averaged across the hosts listed. The benchmark page explains each metric and has every other framework.

Marko: latest benchmark per build and page
BuildPathPerfFCPRaw FCPLCPTBTCLSSITTIDocHosts
Book list /
baseline/85(good)1.510.97(poor)4.26(good)0(good)0.0002.294.261433/3 Vercel, Netlify, Cloudflare
optimized/92(good)0.960.93(needs improvement)3.35(good)0(good)0.0001.963.351053/3 Vercel, Netlify, Cloudflare
Book page /10145787
baseline/1014578797(good)1.510.60(needs improvement)2.57(good)0(good)0.0001.842.571133/3 Vercel, Netlify, Cloudflare
optimized/1014578799(good)0.921.37(good)1.77(good)0(good)0.0002.391.771603/3 Vercel, Netlify, Cloudflare
  • Good
  • Needs improvement
  • Poor

FCP 1.8 s / 3 s · LCP 2.5 s / 4 s · TBT 200 ms / 600 ms · CLS 0.1 / 0.25

Per host

The medians above before averaging. Runs is how many measured runs went into each median. Host names link to the deployment.

Marko: latest benchmark per build, page and host
BuildPathHostPerfFCPRaw FCPLCPTBTCLSSITTIDocRunsStatus
Marko
baseline/Vercel85(good)1.510.18(poor)4.36(good)0(good)0.0001.514.36743/3OK
baseline/Netlify85(good)1.522.31(poor)4.07(good)0(good)0.0003.854.071673/3OK
baseline/Cloudflare85(good)1.510.43(poor)4.36(good)0(good)0.0001.514.361893/3OK
baseline/10145787Vercel97(good)1.510.19(needs improvement)2.56(good)0(good)0.0001.512.56683/3OK
baseline/10145787Netlify97(good)1.511.32(needs improvement)2.56(good)0(good)0.0002.472.561543/3OK
baseline/10145787Cloudflare97(good)1.510.28(needs improvement)2.59(good)0(good)0.0001.542.591173/3OK
optimized/Vercel92(good)0.910.26(needs improvement)3.31(good)0(good)0.0000.913.31753/3OK
optimized/Netlify89(good)1.072.30(needs improvement)3.60(good)0(good)0.0003.963.601423/3OK
optimized/Cloudflare94(good)0.910.23(needs improvement)3.15(good)0(good)0.0001.003.15983/3OK
optimized/10145787Vercel98(good)0.912.33(good)1.67(good)0(good)0.0003.661.671303/3OK
optimized/10145787Netlify100(good)0.940.30(good)1.83(good)0(good)0.0011.071.831283/3OK
optimized/10145787Cloudflare99(good)0.921.48(good)1.81(good)0(good)0.0002.441.812233/3OK