Update from Statamic 6.40.0 to Statamic 6.42.0 and your site does the same work in a lot less time, and the bigger the site, the bigger the saving. On our 2,000-article test site, rebuilding Statamic's content cache went from 9.71 s to 2.91 s, warming the static cache from 306 s to 120 s, and the Control Panel's entries listing from 531 ms to 207 ms. On a 9,000-article version of the same site, that listing went from 1.70 s to 379 ms. Nothing changed in what the sites returned: every page, query and listing gave the same answer on all three versions.

We measured Statamic 6.40.0, 6.41.0 and 6.42.0 side by side with statamic-bench, our open benchmark, so you can run the same tests on your own machine. We ran it on three sizes of the same site. Most figures below are from the middle one, with 2,000 articles; the section on site size has the rest. Here's what got faster, who made it faster, and where our numbers differ from the ones in the pull requests.

Deploys and cache clears: 70% less time

Statamic keeps your content in flat files. To answer quickly it builds an index of them, the Stache, and it has to rebuild that index after a deploy or a cache clear. That rebuild is the biggest win in these releases.

A full php please stache:warm took 9.71 s on Statamic 6.40.0, 3.94 s on 6.41.0 and 2.91 s on 6.42.0. If you don't warm the Stache and let the first visitor do it instead, that visitor's first query waited 6.01 s on 6.40.0 and 1.55 s on 6.42.0. It also takes less memory: the build peaked at 452 MB on 6.40.0 and 275 MB on 6.42.0.

Bar chart: a full Stache build took 9.71 s on Statamic 6.40.0, 3.94 s on 6.41.0 and 2.91 s on 6.42.0; the first query after a cache clear took 6.01 s, 1.57 s and 1.55 s

Most of this arrived in 6.41.0:

  • A faster YAML parser that reads each line once, by @ryanmitchell, built with @DanielDarrenJones (#15838). Entries with Bard or Replicator content gain most, because that's nested YAML.
  • Quicker file traversal (#15821) and one collection lookup per build instead of one per entry (#15826), both from @ryanmitchell.
  • Entry URLs for plain routes like /articles/{slug} worked out without starting Antlers (#15841), and entries no longer held in memory twice during a build (#15795), from @DanielDarrenJones.

Statamic 6.42.0 took a further 26% off the full build. @ryanmitchell made each taxonomy term once when building term indexes (#15871) and built term associations once per warm rather than twice (#15872).

Static caching: half the time to warm

If you use static caching, php please static:warm visits every page so visitors get a cached copy. With the half measure strategy it took 306 s on Statamic 6.40.0, 276 s on 6.41.0 and 120 s on 6.42.0. On the 200-article site it went from 42.5 s to 12.9 s.

Bar chart: static:warm took 306 s on Statamic 6.40.0, 276 s on 6.41.0 and 120 s on 6.42.0

The change aimed at this is @DanielDarrenJones's #15852. With ignore_query_strings on, which is the default, ?page=2 and later pages are cached under the same URL as the first page, so warming them was wasted work. Statamic 6.42.0 skips them: 3,888 requests on our site instead of 4,937. That's about a fifth fewer requests, yet the warm took 61% less time, so most of the saving comes from each page being quicker to render, thanks to the changes below. We haven't split it further than that.

Front-end pages: 10 to 42% quicker

With static caching off, every page we timed was faster on Statamic 6.42.0 than on 6.40.0. Listings gained most: the articles listing went from 608 ms to 352 ms, a tag page from 508 ms to 299 ms and the home page from 533 ms to 353 ms. A single article went from 451 ms to 312 ms.

Bar chart of front-end page times on Statamic 6.40.0, 6.41.0 and 6.42.0: the articles listing falls from 608 ms to 352 ms and the home page from 533 ms to 353 ms

These timings are long because each one includes starting PHP and Laravel from cold, so compare them with each other rather than with your own site's response times. More on that under "How we measured".

The home page gained most in 6.41.0. It shows the same navigation twice, and the nav tag now reuses the tree it built the first time, from @DanielDarrenJones (#15845). Listings and tag pages gain from the term and query changes in both releases.

The Control Panel: listings in under half the time

The entries listing (50 rows, sorted by date, with an entries field and two taxonomy fields as columns) took 531 ms on Statamic 6.40.0, 258 ms on 6.41.0 and 207 ms on 6.42.0. Searching the same listing went from 517 ms to 178 ms.

Bar chart of Control Panel timings on Statamic 6.40.0, 6.41.0 and 6.42.0: the entries listing falls from 531 ms to 207 ms and reordering 1,000 docs from 402 ms to 245 ms

In 6.41.0, @DanielDarrenJones kept parsed blueprint YAML between requests (#15813), worked out fieldtype config defaults once (#15805) and looked term associations up instead of reading through all of them (#15846). In 6.42.0 he also made an entries field look its entries up once per cell (#15890), skipped the lookup when the field is empty (#15879), narrowed term queries to the taxonomies their ids name (#15878) and lowercased the value for an equals where once (#15894).

Reordering a structured collection is quicker in 6.42.0. Moving the first of 1,000 docs to the end and saving took 402 ms on 6.40.0, 437 ms on 6.41.0 and 245 ms on 6.42.0, now that each index is written once per reorder (#15888, @DanielDarrenJones). Saving ten entries went from 402 ms to 348 ms, and opening an entry with a large page-builder blueprint from 115 ms to 107 ms.

Queries in your templates

Three kinds of query got much quicker in Statamic 6.42.0. These are the first run of each query in a request, with the Stache already built:

  • Entries whose title contains "amber" (167 of 2,000): 26.8 ms on 6.40.0, 27.6 ms on 6.41.0 and 21.1 ms on 6.42.0. @DanielDarrenJones now works out the like pattern once per query instead of once per entry (#15895).
  • The latest four published articles by date: 35.4 ms, 35.1 ms and 22.6 ms. Sort values are now prepared once rather than on every comparison, also from @DanielDarrenJones (#15877).
  • A search for "amber" (702 results), filtered by status and site and paginated by 10: 176 ms, 183 ms and 95.0 ms. Paginated search results are now worked out once, and filters are combined without comparing every result with every other, from @DanielDarrenJones (#15889).

Bar chart of query times on Statamic 6.40.0, 6.41.0 and 6.42.0: a paginated search falls from 176 ms to 95.0 ms

Memory

Rebuilding the Stache needs 39% less memory on Statamic 6.42.0 than on 6.40.0: 452 MB down to 275 MB at its peak. Letting the first query rebuild it instead peaked at 381 MB on 6.40.0 and 139 MB on 6.42.0. That matters on small servers and in containers with a memory limit.

Bar chart of peak memory on Statamic 6.40.0, 6.41.0 and 6.42.0: a full Stache build falls from 452 MB to 275 MB

Single requests use a little less too. The home page peaked at 51.3 MB on 6.40.0 and 38.8 MB on 6.42.0, and the articles listing at 55.0 MB and 44.1 MB. Most other pages moved by about 1 MB or less, either way. These figures include starting Laravel and Statamic.

Bigger sites gain more

We ran the same tests on a small site (200 articles, 458 entries in all), the medium one (2,000 articles, 3,700 entries) and a large one (9,000 articles, 13,666 entries). Almost everything got faster on all three, but the larger the site, the bigger the saving.

Bar chart of the time Statamic 6.42.0 takes as a share of what 6.40.0 took, on small, medium and large sites: the Control Panel entries listing takes 70%, 39% and 22% of the time

On the large site:

  • A full Stache build took 42.0 s on Statamic 6.40.0, 16.4 s on 6.41.0 and 11.4 s on 6.42.0, and its peak memory fell from 1,826 MB to 1,197 MB. Letting the first query rebuild it instead took 27.4 s on 6.40.0 and 6.43 s on 6.42.0.
  • The articles listing page went from 1.66 s to 694 ms, the home page from 1.16 s to 519 ms and a single article from 1.16 s to 614 ms.
  • The Control Panel's entries listing went from 1.70 s to 379 ms, and searching it from 1.60 s to 257 ms.
  • A search for "amber" (3,039 results), paginated by 10, went from 1.06 s to 356 ms, and reordering 2,000 docs from 921 ms to 461 ms.

On the small site the gains are real but modest. Front-end pages came back 15 to 20% sooner, nearly all of it from 6.41.0, and the Control Panel listing 30% sooner. With only a few hundred entries there's less work for the changes to save.

Where our numbers differ from the pull requests

The pull requests include their authors' own benchmarks. Ours mostly agree, and where they don't, it's usually because our test site is shaped differently. These compare Statamic 6.41.0 with 6.42.0, where the changes landed:

  • Like-wheres. #15895 reports 7.0 ms to 0.7 ms for the filtering on 2,000 entries. We measured 7.1 ms to 0.84 ms for the same step. Once the 167 matching entries are fetched as well, the saving is smaller: 21.3 ms to 14.7 ms (−31%), because fetching them now takes most of the time.
  • Latest four by date. #15877 reports 25.9 ms to 14.6 ms. We measured 25.3 ms to 12.7 ms with the query run 20 times, and 35.1 ms to 22.6 ms for its first run in a request.
  • Paginated search. #15889 reports about 393 ms to about 165 ms for 1,022 hits (−58%). We measured 183 ms to 95.0 ms for 702 hits (−48%) and 1.09 s to 356 ms for 3,039 hits (−67%). The saving grows with the number of hits, which our three sizes bear out.
  • Listing with an entries field. #15879 reports −41% on a listing where 62 of 64 entries had the field empty. Our listing also has two taxonomy columns, and about one row in ten has an entry selected. Statamic 6.42.0 took 20% less time than 6.41.0.
  • Reordering. #15888 reports about 1,100 ms to about 440 ms for 2,000 entries. With 2,000 docs we measured 942 ms to 461 ms (−51%), and with 1,000 docs 437 ms to 245 ms (−44%).
  • Full Stache build in 6.42.0. #15871 reports −29% on 1,000 articles and #15872 a further −8%. Together on our site, Statamic 6.42.0 took 26% less time than 6.41.0.
  • static:warm. #15852 reports about a third less time. We measured 57% less than 6.41.0 on the medium site and 67% less on the small one. Skipped ?page= URLs account for only part of that; faster rendering does the rest.

A few things were slightly slower on Statamic 6.41.0 than on 6.40.0 on the medium site: the reorder (+9%), the like-where with entries fetched (+5%) and the paginated search (+4%). Each held in every round, so they're real, if small. The small site showed the same for the reorder (+9%). We haven't traced the cause. Statamic 6.42.0 is faster than both earlier versions on all of them.

How we measured

All the numbers come from 1994limited/statamic-bench. It installs Statamic from Composer, generates the same test site for each version, and times each job in a fresh PHP process.

  • Machine. Apple M1 Pro with 16 GB, macOS 26.0.1, PHP 8.5.12 with opcache, Laravel 13.42.0.
  • Sites. For each size, three installs identical apart from statamic/cms, with the same generated content. The medium site has 2,000 dated articles with Bard bodies, tags and categories; a structured collection of 1,000 docs; 300 products, 200 events and 30 people; a page builder with a large blueprint; and a multi-level page tree. The small site has 200 articles and 100 docs, the large one 9,000 articles and 2,000 docs, with the rest scaled to match. File cache, Stache watcher off.
  • Runs. Three rounds, with the order of the versions changed every round. We only call something faster or slower when every round agrees. Front-end pages, Control Panel requests and queries ran 10 times per round (6 on the large site), and builds, saves and reorders 3, each reorder and save starting from the same content. static:warm ran twice per round.
  • Fresh processes. Every request starts PHP from scratch, which is why page times are in hundreds of milliseconds. A production server keeps PHP running between requests, so its times are shorter. An earlier, smaller run of ours through PHP-FPM showed the same pattern between versions. static:warm ran against PHP's own server with 8 workers.
  • Same answers. Every query returned the same entries, every listing the same rows and every front-end page the same HTML on all three versions. Built Stache contents matched too.
  • Caveats. We picked what to measure from the changelogs, so this shows where the releases aimed to help, not an average site. It's one machine and one generated site per size, and the Mac was doing other work at the time. That moved static:warm on the medium site by up to 20% between rounds, though 6.42.0 was the fastest by a wide margin in every round.

To run it yourself:

git clone https://github.com/1994limited/statamic-bench && cd statamic-bench
bin/bench setup v640 --cms=6.40.0 --size=medium
bin/bench setup v642 --cms=6.42.0 --size=medium
bin/bench compare v640 v642

Disclosure: Daniel Jones, who edits antlers/news, wrote statamic-bench and many of the pull requests measured here as @DanielDarrenJones.

Daniel Jones

Editor at antlers/news

antlers/news is independent but blessed by Statamic.