From f5c69e82533cb4fa0b6c6a0ad5ac0a44d3e913ad Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 13:12:26 +0400 Subject: [PATCH 1/8] docs(benchmarks): add the PHP ORM benchmarks page The page renders the runs of php-testo/benchmarks-orm: its Publish workflow adds one file per release to data/benchmarks/orm/. Any run can be opened from the history, with its metadata, the versions under test and what changed since the previous run; per database, an overall ranking, the scenario matrix relative to PDO, a head-to-head of two ORMs, one ORM across databases, memory and the trend over runs. The data loader fails the build on a file the page can't render. Assisted-By: Claude Opus 5.5 --- .vitepress/config.mts | 2 + .vitepress/theme/OrmBenchmarks.vue | 737 ++++++++++++++++++++++++ .vitepress/theme/index.ts | 2 + .vitepress/theme/orm-benchmarks.data.ts | 72 +++ .vitepress/theme/style.css | 6 + benchmarks/orm.md | 27 + ru/benchmarks/orm.md | 27 + 7 files changed, 873 insertions(+) create mode 100644 .vitepress/theme/OrmBenchmarks.vue create mode 100644 .vitepress/theme/orm-benchmarks.data.ts create mode 100644 benchmarks/orm.md create mode 100644 ru/benchmarks/orm.md diff --git a/.vitepress/config.mts b/.vitepress/config.mts index d922f12..cf2f97f 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -85,6 +85,7 @@ gtag('config', 'G-VYGDN3X0PR');`], nav: [ { text: 'Docs', link: '/docs/intro/getting-started.md' }, { text: 'Blog', link: '/blog/' }, + { text: 'Benchmarks', link: '/benchmarks/orm.md' }, ], editLink: { pattern: 'https://github.com/php-testo/php-testo.github.io/edit/master/:path', @@ -170,6 +171,7 @@ gtag('config', 'G-VYGDN3X0PR');`], nav: [ { text: 'Документация', link: '/ru/docs/intro/getting-started.md' }, { text: 'Блог', link: '/ru/blog/' }, + { text: 'Бенчмарки', link: '/ru/benchmarks/orm.md' }, ], editLink: { pattern: 'https://github.com/php-testo/php-testo.github.io/edit/master/:path', diff --git a/.vitepress/theme/OrmBenchmarks.vue b/.vitepress/theme/OrmBenchmarks.vue new file mode 100644 index 0000000..69005c8 --- /dev/null +++ b/.vitepress/theme/OrmBenchmarks.vue @@ -0,0 +1,737 @@ + + + + + diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index 2e116bd..7a746ca 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -6,6 +6,7 @@ import BlogSponsor from './BlogSponsor.vue' import GitHubStars from './GitHubStars.vue' import CodeTabs from './CodeTabs.vue' import HomeBench from './HomeBench.vue' +import OrmBenchmarks from './OrmBenchmarks.vue' import JetBrainsPluginButton from './JetBrainsPluginButton.vue' import JetBrainsPlugin from './JetBrainsPlugin.vue' import OpenIdePluginButton from './OpenIdePluginButton.vue' @@ -156,6 +157,7 @@ export default { enhanceApp({ app, router }) { app.component('CodeTabs', CodeTabs) app.component('HomeBench', HomeBench) + app.component('OrmBenchmarks', OrmBenchmarks) app.component('JetBrainsPluginButton', JetBrainsPluginButton) app.component('JetBrainsPlugin', JetBrainsPlugin) app.component('OpenIdePluginButton', OpenIdePluginButton) diff --git a/.vitepress/theme/orm-benchmarks.data.ts b/.vitepress/theme/orm-benchmarks.data.ts new file mode 100644 index 0000000..d5a04e3 --- /dev/null +++ b/.vitepress/theme/orm-benchmarks.data.ts @@ -0,0 +1,72 @@ +import { readFileSync } from 'node:fs' +import { basename } from 'node:path' + +/** + * The runs of php-testo/benchmarks-orm, one file per release in `data/benchmarks/orm/`. The Publish workflow of that + * repository adds them after validating each against its schema; the checks here only make sure a file the page + * can't render fails the build instead of the page. + */ + +export type ScenarioGroup = 'read' | 'relations' | 'bulk' | 'write' + +export interface Measurement { + /** Microseconds per operation. */ + time: number + rstdev: number + /** Peak memory of the process, bytes. */ + memory: number + /** The time divided by the PDO baseline. */ + ratio: number +} + +export interface Database { + id: 'sqlite' | 'pgsql' | 'mysql' + label: string + server: string + date: string + machine: { cpu: string, cores: number, os: string, runner: string | null, php: string } + baseline: Record + results: Record> +} + +export interface Run { + schema: 1 + release: string + date: string + source: { repository: string, commit: string | null, run: string | null } + php: string + scenarios: { id: string, group: ScenarioGroup, label: string, revs: number, iterations: number }[] + contenders: { id: string, label: string, package: string, version: string }[] + databases: Database[] +} + +declare const data: Run[] +export { data } + +function check(run: Run, file: string): Run { + const fail = (what: string): never => { + throw new Error(`${file}: ${what}`) + } + run.schema === 1 || fail(`schema ${run.schema}, the page renders schema 1`) + basename(file, '.json') === run.release || fail(`holds release ${run.release}`) + Number.isNaN(Date.parse(run.date)) && fail(`bad date ${run.date}`) + run.scenarios?.length && run.contenders?.length && run.databases?.length || fail('no scenarios, contenders or databases') + for (const db of run.databases) { + for (const scenario of run.scenarios) { + db.baseline[scenario.id]?.time > 0 || fail(`${db.id}: no PDO time for ${scenario.id}`) + for (const contender of run.contenders) { + db.results[contender.id]?.[scenario.id]?.ratio > 0 || fail(`${db.id}: no ${contender.id} result for ${scenario.id}`) + } + } + } + return run +} + +export default { + watch: ['../../data/benchmarks/orm/*.json'], + load(files: string[]): Run[] { + return files + .map(file => check(JSON.parse(readFileSync(file, 'utf-8')), file)) + .sort((a, b) => Date.parse(b.date) - Date.parse(a.date)) + }, +} diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index c0887f5..e74d421 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -1362,3 +1362,9 @@ a.featured-post-card:hover { align-items: center; gap: 12px; } + +/* The ORM benchmarks page: wide tables, no sidebar or outline. */ +.orm-bench-page .VPDoc:not(.has-sidebar) .container, +.orm-bench-page .VPDoc:not(.has-sidebar) .content { + max-width: 1152px; +} diff --git a/benchmarks/orm.md b/benchmarks/orm.md new file mode 100644 index 0000000..9b2c401 --- /dev/null +++ b/benchmarks/orm.md @@ -0,0 +1,27 @@ +--- +title: PHP ORM Benchmarks +description: Cycle ORM, Doctrine, Eloquent and Yii ActiveRecord compared on the same scenarios against hand-written PDO, on SQLite, PostgreSQL and MySQL. +aside: false +outline: false +editLink: false +pageClass: orm-bench-page +--- + +# PHP ORM Benchmarks + +How much an ORM costs compared to the queries you would write by hand. Every ORM runs the same scenarios on the same data, and every result is divided by the time of hand-written PDO measured on the same machine in the same run: `3.0×` means three times slower than plain PDO. + +The numbers come from [php-testo/benchmarks-orm](https://github.com/php-testo/benchmarks-orm). Each release of that repository benchmarks the ORM versions it pins and publishes the run here, so you can go back to any earlier run and see how the ORMs changed between versions. + + + +## How it is measured + +- **Same data.** 1000 users with 10 posts each. SQLite lives in memory; PostgreSQL and MySQL run as services next to the runner. +- **Same work.** Before measuring, every ORM is checked against PDO: the same rows loaded, the same rows written, everything rolled back. +- **Isolated processes.** Each ORM has its own Composer project, and [PHPBench](https://github.com/phpbench/phpbench) runs every iteration in a fresh process with OPcache on. The time shown is the mode of the iterations. +- **Fair baseline.** PDO runs next to every ORM on the same runner; the baseline is the median of those runs, so one noisy run can't skew the ratios. +- **Writes leave no trace.** Inserts, updates and deletes run in a transaction that is rolled back. +- **GitHub-hosted runners.** Absolute times move between runner machines; compare ratios rather than microseconds across runs. + +The scenarios, the entity mappings and the exact settings are in the [repository](https://github.com/php-testo/benchmarks-orm#how-it-works). Spotted something unfair to one of the ORMs? [Open an issue](https://github.com/php-testo/benchmarks-orm/issues). diff --git a/ru/benchmarks/orm.md b/ru/benchmarks/orm.md new file mode 100644 index 0000000..69fc74e --- /dev/null +++ b/ru/benchmarks/orm.md @@ -0,0 +1,27 @@ +--- +title: Бенчмарки PHP ORM +description: Cycle ORM, Doctrine, Eloquent и Yii ActiveRecord на одних и тех же сценариях в сравнении с ручным PDO на SQLite, PostgreSQL и MySQL. +aside: false +outline: false +editLink: false +pageClass: orm-bench-page +--- + +# Бенчмарки PHP ORM + +Во что обходится ORM по сравнению с запросами, написанными руками. Все ORM проходят одни и те же сценарии на одних и тех же данных, а каждый результат делится на время ручного PDO, измеренное на той же машине в том же прогоне. `3.0×` значит «в три раза медленнее голого PDO». + +Цифры берутся из [php-testo/benchmarks-orm](https://github.com/php-testo/benchmarks-orm). Каждый релиз этого репозитория измеряет закреплённые в нём версии ORM и публикует прогон здесь. Можно открыть любой прошлый прогон и посмотреть, как ORM менялись от версии к версии. + + + +## Как измеряем + +- **Одни данные.** 1000 пользователей, у каждого 10 постов. SQLite живёт в памяти, PostgreSQL и MySQL работают сервисами рядом с раннером. +- **Одна работа.** Перед замером каждая ORM сверяется с PDO: загружены те же строки, записаны те же строки, всё откатилось. +- **Отдельные процессы.** У каждой ORM свой Composer-проект, а [PHPBench](https://github.com/phpbench/phpbench) запускает каждую итерацию в новом процессе с включённым OPcache. Показано модальное время итераций. +- **Честная точка отсчёта.** PDO запускается рядом с каждой ORM на том же раннере, базой служит медиана этих запусков — один шумный запуск не исказит отношения. +- **Запись без следов.** Вставки, обновления и удаления идут в транзакции, которая откатывается. +- **Раннеры GitHub.** Абсолютное время зависит от машины, которая досталась прогону. Между прогонами сравнивайте отношения, а не микросекунды. + +Сценарии, маппинги сущностей и точные настройки описаны в [репозитории](https://github.com/php-testo/benchmarks-orm#how-it-works). Если какая-то ORM поставлена в неравные условия, [заведите issue](https://github.com/php-testo/benchmarks-orm/issues). From 9a8559409673292bf9dda9c9c4333e947b7b13a8 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 13:13:25 +0400 Subject: [PATCH 2/8] docs(benchmarks): add the Benchmarks section ORM is its first page; the section's index lists the benchmarks, so others can join it later. Assisted-By: Claude Opus 5.5 --- .vitepress/config.mts | 22 ++++++++++++++++++++-- .vitepress/theme/style.css | 6 +++--- benchmarks/index.md | 12 ++++++++++++ ru/benchmarks/index.md | 12 ++++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 benchmarks/index.md create mode 100644 ru/benchmarks/index.md diff --git a/.vitepress/config.mts b/.vitepress/config.mts index cf2f97f..a7fb9ee 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -85,7 +85,7 @@ gtag('config', 'G-VYGDN3X0PR');`], nav: [ { text: 'Docs', link: '/docs/intro/getting-started.md' }, { text: 'Blog', link: '/blog/' }, - { text: 'Benchmarks', link: '/benchmarks/orm.md' }, + { text: 'Benchmarks', link: '/benchmarks/', activeMatch: '^/benchmarks/' }, ], editLink: { pattern: 'https://github.com/php-testo/php-testo.github.io/edit/master/:path', @@ -155,6 +155,15 @@ gtag('config', 'G-VYGDN3X0PR');`], items: [], }, ], + '/benchmarks/': [ + { + text: 'Benchmarks', + link: '/benchmarks/', + items: [ + { text: 'ORM', link: '/benchmarks/orm.md' }, + ], + }, + ], }, }, }, @@ -171,7 +180,7 @@ gtag('config', 'G-VYGDN3X0PR');`], nav: [ { text: 'Документация', link: '/ru/docs/intro/getting-started.md' }, { text: 'Блог', link: '/ru/blog/' }, - { text: 'Бенчмарки', link: '/ru/benchmarks/orm.md' }, + { text: 'Бенчмарки', link: '/ru/benchmarks/', activeMatch: '^/ru/benchmarks/' }, ], editLink: { pattern: 'https://github.com/php-testo/php-testo.github.io/edit/master/:path', @@ -241,6 +250,15 @@ gtag('config', 'G-VYGDN3X0PR');`], items: [], }, ], + '/ru/benchmarks/': [ + { + text: 'Бенчмарки', + link: '/ru/benchmarks/', + items: [ + { text: 'ORM', link: '/ru/benchmarks/orm.md' }, + ], + }, + ], }, outline: { label: 'На этой странице', diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index e74d421..4b55fd3 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -1363,8 +1363,8 @@ a.featured-post-card:hover { gap: 12px; } -/* The ORM benchmarks page: wide tables, no sidebar or outline. */ -.orm-bench-page .VPDoc:not(.has-sidebar) .container, -.orm-bench-page .VPDoc:not(.has-sidebar) .content { +/* The ORM benchmarks page: wide tables, no outline. */ +.orm-bench-page .VPDoc .container, +.orm-bench-page .VPDoc .content { max-width: 1152px; } diff --git a/benchmarks/index.md b/benchmarks/index.md new file mode 100644 index 0000000..9e64b25 --- /dev/null +++ b/benchmarks/index.md @@ -0,0 +1,12 @@ +--- +title: Benchmarks +description: Benchmarks of the PHP ecosystem run by the Testo team, with every run published and kept. +outline: false +editLink: false +--- + +# Benchmarks + +Measurements of PHP libraries on the same scenarios, run on GitHub-hosted runners and republished with every new version of the libraries under test. Each benchmark lives in its own repository, so you can read the code, run it yourself and propose a fix. Every published run stays here: open any earlier one to see how the numbers changed between versions. + +- **[ORM](./orm.md)** — Cycle ORM, Doctrine, Eloquent and Yii ActiveRecord against hand-written PDO on SQLite, PostgreSQL and MySQL. diff --git a/ru/benchmarks/index.md b/ru/benchmarks/index.md new file mode 100644 index 0000000..83fd59a --- /dev/null +++ b/ru/benchmarks/index.md @@ -0,0 +1,12 @@ +--- +title: Бенчмарки +description: Бенчмарки PHP-экосистемы от команды Testo, все прогоны публикуются и сохраняются. +outline: false +editLink: false +--- + +# Бенчмарки + +Замеры PHP-библиотек на одинаковых сценариях. Они выполняются на раннерах GitHub и публикуются заново с каждой новой версией тестируемых библиотек. У каждого бенчмарка свой репозиторий: код можно прочитать, запустить у себя и предложить исправление. Опубликованные прогоны остаются здесь — откройте любой прошлый и посмотрите, как менялись цифры от версии к версии. + +- **[ORM](./orm.md)** — Cycle ORM, Doctrine, Eloquent и Yii ActiveRecord против ручного PDO на SQLite, PostgreSQL и MySQL. From e44a69a1a602ce4ab4b3fae4404c7a0798fab983 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 13:19:34 +0400 Subject: [PATCH 3/8] docs(benchmarks): add the first ORM run Measured by the Benchmarks workflow of php-testo/benchmarks-orm on the branch that adds the publishing; later runs arrive through its Publish workflow. Assisted-By: Claude Opus 5.5 --- data/benchmarks/orm/1.0.0.json | 1696 ++++++++++++++++++++++++++++++++ 1 file changed, 1696 insertions(+) create mode 100644 data/benchmarks/orm/1.0.0.json diff --git a/data/benchmarks/orm/1.0.0.json b/data/benchmarks/orm/1.0.0.json new file mode 100644 index 0000000..2183b17 --- /dev/null +++ b/data/benchmarks/orm/1.0.0.json @@ -0,0 +1,1696 @@ +{ + "schema": 1, + "release": "1.0.0", + "date": "2026-12-02T09:06:52+00:00", + "source": { + "repository": "php-testo/benchmarks-orm", + "commit": "3c95e5f0400d319671acde57837c05a171b83d63", + "run": "https://github.com/php-testo/benchmarks-orm/actions/runs/46847564745" + }, + "php": "8.5.13", + "scenarios": [ + { + "id": "findByPk", + "group": "read", + "label": "Find by primary key", + "revs": 1000, + "iterations": 10 + }, + { + "id": "list10", + "group": "read", + "label": "List of 10 rows", + "revs": 500, + "iterations": 10 + }, + { + "id": "list100", + "group": "read", + "label": "List of 100 rows", + "revs": 100, + "iterations": 10 + }, + { + "id": "list1000", + "group": "read", + "label": "List of 1000 rows", + "revs": 10, + "iterations": 10 + }, + { + "id": "refetch100", + "group": "read", + "label": "100 rows fetched again", + "revs": 100, + "iterations": 10 + }, + { + "id": "arrays100", + "group": "read", + "label": "100 rows as arrays", + "revs": 100, + "iterations": 10 + }, + { + "id": "eagerBelongsTo", + "group": "relations", + "label": "Eager belongs-to, 100 posts", + "revs": 50, + "iterations": 10 + }, + { + "id": "eagerHasMany", + "group": "relations", + "label": "Eager has-many, 20 users", + "revs": 50, + "iterations": 10 + }, + { + "id": "lazyBelongsTo", + "group": "relations", + "label": "Lazy belongs-to, 100 posts", + "revs": 50, + "iterations": 10 + }, + { + "id": "allPosts", + "group": "bulk", + "label": "All 10 000 posts", + "revs": 1, + "iterations": 5 + }, + { + "id": "insert", + "group": "write", + "label": "Insert 100 users", + "revs": 20, + "iterations": 10 + }, + { + "id": "insertGraph", + "group": "write", + "label": "Insert 20 users + 100 posts", + "revs": 20, + "iterations": 10 + }, + { + "id": "update", + "group": "write", + "label": "Update 100 users", + "revs": 20, + "iterations": 10 + }, + { + "id": "delete", + "group": "write", + "label": "Delete 100 posts", + "revs": 20, + "iterations": 10 + } + ], + "contenders": [ + { + "id": "cycle-mapper", + "label": "Cycle DataMapper", + "package": "cycle/orm", + "version": "2.19.1" + }, + { + "id": "cycle-ar", + "label": "Cycle ActiveRecord", + "package": "cycle/active-record", + "version": "1.2.1" + }, + { + "id": "doctrine", + "label": "Doctrine ORM", + "package": "doctrine/orm", + "version": "3.8.0" + }, + { + "id": "eloquent", + "label": "Eloquent", + "package": "illuminate/database", + "version": "13.45.0" + }, + { + "id": "yii", + "label": "Yii ActiveRecord", + "package": "yiisoft/active-record", + "version": "1.1.0" + } + ], + "databases": [ + { + "id": "sqlite", + "label": "SQLite (in memory)", + "server": "SQLite 3.45.1", + "date": "2026-12-02T09:06:52+00:00", + "machine": { + "cpu": "AMD EPYC 7763 64-Core Processor", + "cores": 4, + "os": "Linux 7.0.0-1020-azure", + "runner": "ubuntu24 20261122.23.1", + "php": "8.5.13" + }, + "baseline": { + "findByPk": { + "time": 3.776, + "memory": 1518904, + "runs": 5 + }, + "list10": { + "time": 18.357, + "memory": 1518904, + "runs": 5 + }, + "list100": { + "time": 151.222, + "memory": 1518904, + "runs": 5 + }, + "list1000": { + "time": 1486.256, + "memory": 1612992, + "runs": 5 + }, + "refetch100": { + "time": 150.912, + "memory": 1518904, + "runs": 5 + }, + "arrays100": { + "time": 47.894, + "memory": 1518904, + "runs": 5 + }, + "eagerBelongsTo": { + "time": 225.047, + "memory": 1518952, + "runs": 5 + }, + "eagerHasMany": { + "time": 457.089, + "memory": 10575032, + "runs": 5 + }, + "lazyBelongsTo": { + "time": 220.173, + "memory": 1518952, + "runs": 5 + }, + "allPosts": { + "time": 16235.292, + "memory": 14221616, + "runs": 5 + }, + "insert": { + "time": 395.596, + "memory": 1518904, + "runs": 5 + }, + "insertGraph": { + "time": 557.807, + "memory": 2036208, + "runs": 5 + }, + "update": { + "time": 299.033, + "memory": 1518904, + "runs": 5 + }, + "delete": { + "time": 305.819, + "memory": 1518904, + "runs": 5 + } + }, + "results": { + "cycle-mapper": { + "findByPk": { + "time": 89.859, + "rstdev": 1.48, + "memory": 6023064, + "ratio": 23.7958 + }, + "list10": { + "time": 191.493, + "rstdev": 3.79, + "memory": 6017640, + "ratio": 10.4317 + }, + "list100": { + "time": 913.361, + "rstdev": 3.63, + "memory": 6017640, + "ratio": 6.0399 + }, + "list1000": { + "time": 6713.783, + "rstdev": 3.31, + "memory": 7608472, + "ratio": 4.5172 + }, + "refetch100": { + "time": 564.286, + "rstdev": 4.91, + "memory": 6274832, + "ratio": 3.7392 + }, + "arrays100": { + "time": 433.38, + "rstdev": 4.27, + "memory": 5948008, + "ratio": 9.0488 + }, + "eagerBelongsTo": { + "time": 2176.055, + "rstdev": 3.99, + "memory": 10703552, + "ratio": 9.6693 + }, + "eagerHasMany": { + "time": 2657.44, + "rstdev": 1.46, + "memory": 21597000, + "ratio": 5.8138 + }, + "lazyBelongsTo": { + "time": 1973.769, + "rstdev": 1.56, + "memory": 6336624, + "ratio": 8.9646 + }, + "allPosts": { + "time": 79870.961, + "rstdev": 9.43, + "memory": 38498248, + "ratio": 4.9196 + }, + "insert": { + "time": 5743.49, + "rstdev": 3.41, + "memory": 6250232, + "ratio": 14.5186 + }, + "insertGraph": { + "time": 7184.285, + "rstdev": 2.09, + "memory": 6684912, + "ratio": 12.8795 + }, + "update": { + "time": 6638.467, + "rstdev": 4.7, + "memory": 6468080, + "ratio": 22.1998 + }, + "delete": { + "time": 4586.405, + "rstdev": 2.91, + "memory": 6293448, + "ratio": 14.9971 + } + }, + "cycle-ar": { + "findByPk": { + "time": 112.857, + "rstdev": 3.12, + "memory": 6037600, + "ratio": 29.8861 + }, + "list10": { + "time": 232.595, + "rstdev": 2.43, + "memory": 6032144, + "ratio": 12.6707 + }, + "list100": { + "time": 1064.801, + "rstdev": 3.35, + "memory": 6087792, + "ratio": 7.0413 + }, + "list1000": { + "time": 7709.397, + "rstdev": 2.45, + "memory": 7982224, + "ratio": 5.1871 + }, + "refetch100": { + "time": 547.359, + "rstdev": 3.49, + "memory": 6325336, + "ratio": 3.627 + }, + "arrays100": { + "time": 485.738, + "rstdev": 2.84, + "memory": 5958008, + "ratio": 10.142 + }, + "eagerBelongsTo": { + "time": 2366.091, + "rstdev": 6.27, + "memory": 10608808, + "ratio": 10.5138 + }, + "eagerHasMany": { + "time": 2855.203, + "rstdev": 3.65, + "memory": 15906552, + "ratio": 6.2465 + }, + "lazyBelongsTo": { + "time": 2188.201, + "rstdev": 3.65, + "memory": 6394592, + "ratio": 9.9386 + }, + "allPosts": { + "time": 89959.309, + "rstdev": 2.65, + "memory": 42112000, + "ratio": 5.541 + }, + "insert": { + "time": 12444.584, + "rstdev": 1.64, + "memory": 6209704, + "ratio": 31.4578 + }, + "insertGraph": { + "time": 9979.314, + "rstdev": 1.87, + "memory": 6343672, + "ratio": 17.8903 + }, + "update": { + "time": 12806.347, + "rstdev": 2.07, + "memory": 6389624, + "ratio": 42.8258 + }, + "delete": { + "time": 9966.801, + "rstdev": 2.0, + "memory": 6230784, + "ratio": 32.5905 + } + }, + "doctrine": { + "findByPk": { + "time": 125.698, + "rstdev": 1.12, + "memory": 7283656, + "ratio": 33.2865 + }, + "list10": { + "time": 267.403, + "rstdev": 2.22, + "memory": 8011696, + "ratio": 14.5669 + }, + "list100": { + "time": 1158.643, + "rstdev": 6.26, + "memory": 11178976, + "ratio": 7.6619 + }, + "list1000": { + "time": 8741.151, + "rstdev": 2.86, + "memory": 12352936, + "ratio": 5.8813 + }, + "refetch100": { + "time": 781.896, + "rstdev": 3.79, + "memory": 7442976, + "ratio": 5.1812 + }, + "arrays100": { + "time": 583.078, + "rstdev": 5.32, + "memory": 4172064, + "ratio": 12.1744 + }, + "eagerBelongsTo": { + "time": 1695.239, + "rstdev": 3.11, + "memory": 7462368, + "ratio": 7.5328 + }, + "eagerHasMany": { + "time": 2872.274, + "rstdev": 1.21, + "memory": 12068384, + "ratio": 6.2838 + }, + "lazyBelongsTo": { + "time": 2550.94, + "rstdev": 2.76, + "memory": 7453344, + "ratio": 11.5861 + }, + "allPosts": { + "time": 92783.342, + "rstdev": 2.9, + "memory": 23194280, + "ratio": 5.7149 + }, + "insert": { + "time": 3896.723, + "rstdev": 3.1, + "memory": 4670504, + "ratio": 9.8502 + }, + "insertGraph": { + "time": 4786.152, + "rstdev": 9.81, + "memory": 4078488, + "ratio": 8.5803 + }, + "update": { + "time": 3427.848, + "rstdev": 3.11, + "memory": 7443704, + "ratio": 11.4631 + }, + "delete": { + "time": 3500.379, + "rstdev": 2.32, + "memory": 7447784, + "ratio": 11.4459 + } + }, + "eloquent": { + "findByPk": { + "time": 177.813, + "rstdev": 0.8, + "memory": 4528288, + "ratio": 47.087 + }, + "list10": { + "time": 287.681, + "rstdev": 2.91, + "memory": 4533816, + "ratio": 15.6716 + }, + "list100": { + "time": 1189.528, + "rstdev": 3.43, + "memory": 4587176, + "ratio": 7.8661 + }, + "list1000": { + "time": 6624.185, + "rstdev": 4.62, + "memory": 4056936, + "ratio": 4.457 + }, + "refetch100": { + "time": 1195.757, + "rstdev": 1.4, + "memory": 4587176, + "ratio": 7.9236 + }, + "arrays100": { + "time": 411.805, + "rstdev": 5.78, + "memory": 4459576, + "ratio": 8.5983 + }, + "eagerBelongsTo": { + "time": 2795.108, + "rstdev": 3.04, + "memory": 4850328, + "ratio": 12.4201 + }, + "eagerHasMany": { + "time": 3277.549, + "rstdev": 1.15, + "memory": 4830608, + "ratio": 7.1705 + }, + "lazyBelongsTo": { + "time": 13924.693, + "rstdev": 1.38, + "memory": 5052808, + "ratio": 63.2444 + }, + "allPosts": { + "time": 69258.883, + "rstdev": 1.69, + "memory": 22932504, + "ratio": 4.2659 + }, + "insert": { + "time": 14287.591, + "rstdev": 2.57, + "memory": 5058704, + "ratio": 36.1166 + }, + "insertGraph": { + "time": 18699.949, + "rstdev": 1.31, + "memory": 5545672, + "ratio": 33.524 + }, + "update": { + "time": 13898.518, + "rstdev": 2.68, + "memory": 4305752, + "ratio": 46.4782 + }, + "delete": { + "time": 7406.227, + "rstdev": 4.05, + "memory": 4616024, + "ratio": 24.2177 + } + }, + "yii": { + "findByPk": { + "time": 100.157, + "rstdev": 0.86, + "memory": 2745160, + "ratio": 26.5227 + }, + "list10": { + "time": 178.183, + "rstdev": 2.8, + "memory": 2753000, + "ratio": 9.7066 + }, + "list100": { + "time": 712.652, + "rstdev": 2.14, + "memory": 2810960, + "ratio": 4.7126 + }, + "list1000": { + "time": 4151.26, + "rstdev": 2.45, + "memory": 3379408, + "ratio": 2.7931 + }, + "refetch100": { + "time": 711.324, + "rstdev": 3.83, + "memory": 2811352, + "ratio": 4.7135 + }, + "arrays100": { + "time": 621.988, + "rstdev": 4.56, + "memory": 2811112, + "ratio": 12.9869 + }, + "eagerBelongsTo": { + "time": 1298.117, + "rstdev": 3.52, + "memory": 3004928, + "ratio": 5.7682 + }, + "eagerHasMany": { + "time": 1767.745, + "rstdev": 5.37, + "memory": 2944520, + "ratio": 3.8674 + }, + "lazyBelongsTo": { + "time": 6394.273, + "rstdev": 2.09, + "memory": 3070136, + "ratio": 29.0421 + }, + "allPosts": { + "time": 44688.845, + "rstdev": 3.82, + "memory": 19641656, + "ratio": 2.7526 + }, + "insert": { + "time": 6454.629, + "rstdev": 3.29, + "memory": 2613832, + "ratio": 16.3162 + }, + "insertGraph": { + "time": 7894.59, + "rstdev": 2.44, + "memory": 2613880, + "ratio": 14.1529 + }, + "update": { + "time": 4219.054, + "rstdev": 3.12, + "memory": 2811856, + "ratio": 14.109 + }, + "delete": { + "time": 2537.859, + "rstdev": 4.93, + "memory": 2835792, + "ratio": 8.2986 + } + } + } + }, + { + "id": "pgsql", + "label": "PostgreSQL", + "server": "PostgreSQL 18.7 (Debian 18.7-1.pgdg13+5)", + "date": "2026-12-02T09:06:50+00:00", + "machine": { + "cpu": "AMD EPYC 7763 64-Core Processor", + "cores": 4, + "os": "Linux 7.0.0-1020-azure", + "runner": "ubuntu24 20261129.29.1", + "php": "8.5.13" + }, + "baseline": { + "findByPk": { + "time": 149.771, + "memory": 727272, + "runs": 5 + }, + "list10": { + "time": 206.566, + "memory": 727672, + "runs": 5 + }, + "list100": { + "time": 376.951, + "memory": 775408, + "runs": 5 + }, + "list1000": { + "time": 2675.242, + "memory": 1614256, + "runs": 5 + }, + "refetch100": { + "time": 381.41, + "memory": 753328, + "runs": 5 + }, + "arrays100": { + "time": 250.523, + "memory": 723576, + "runs": 5 + }, + "eagerBelongsTo": { + "time": 842.968, + "memory": 1121400, + "runs": 5 + }, + "eagerHasMany": { + "time": 1106.454, + "memory": 10577512, + "runs": 5 + }, + "lazyBelongsTo": { + "time": 1954.116, + "memory": 820920, + "runs": 5 + }, + "allPosts": { + "time": 30780.468, + "memory": 14222976, + "runs": 5 + }, + "insert": { + "time": 15987.205, + "memory": 766048, + "runs": 5 + }, + "insertGraph": { + "time": 21207.344, + "memory": 2039584, + "runs": 5 + }, + "update": { + "time": 15308.574, + "memory": 785920, + "runs": 5 + }, + "delete": { + "time": 13742.581, + "memory": 783080, + "runs": 5 + } + }, + "results": { + "cycle-mapper": { + "findByPk": { + "time": 276.596, + "rstdev": 3.06, + "memory": 2949608, + "ratio": 1.8468 + }, + "list10": { + "time": 433.895, + "rstdev": 2.13, + "memory": 2944136, + "ratio": 2.1005 + }, + "list100": { + "time": 1175.111, + "rstdev": 1.51, + "memory": 2998792, + "ratio": 3.1174 + }, + "list1000": { + "time": 7535.323, + "rstdev": 3.51, + "memory": 4534968, + "ratio": 2.8167 + }, + "refetch100": { + "time": 774.284, + "rstdev": 5.55, + "memory": 3201328, + "ratio": 2.0301 + }, + "arrays100": { + "time": 636.617, + "rstdev": 2.64, + "memory": 2874504, + "ratio": 2.5412 + }, + "eagerBelongsTo": { + "time": 2733.075, + "rstdev": 3.01, + "memory": 7428200, + "ratio": 3.2422 + }, + "eagerHasMany": { + "time": 3348.309, + "rstdev": 2.25, + "memory": 18526880, + "ratio": 3.0262 + }, + "lazyBelongsTo": { + "time": 4049.855, + "rstdev": 3.67, + "memory": 3264576, + "ratio": 2.0725 + }, + "allPosts": { + "time": 95082.356, + "rstdev": 3.97, + "memory": 35424840, + "ratio": 3.089 + }, + "insert": { + "time": 24296.912, + "rstdev": 2.53, + "memory": 3227064, + "ratio": 1.5198 + }, + "insertGraph": { + "time": 31763.294, + "rstdev": 1.23, + "memory": 3478432, + "ratio": 1.4977 + }, + "update": { + "time": 26956.411, + "rstdev": 2.38, + "memory": 3436864, + "ratio": 1.7609 + }, + "delete": { + "time": 22210.957, + "rstdev": 1.89, + "memory": 3221560, + "ratio": 1.6162 + } + }, + "cycle-ar": { + "findByPk": { + "time": 291.198, + "rstdev": 2.33, + "memory": 2964528, + "ratio": 1.9443 + }, + "list10": { + "time": 461.763, + "rstdev": 13.84, + "memory": 2959024, + "ratio": 2.2354 + }, + "list100": { + "time": 1304.902, + "rstdev": 5.81, + "memory": 3006512, + "ratio": 3.4617 + }, + "list1000": { + "time": 8545.8, + "rstdev": 3.72, + "memory": 4909104, + "ratio": 3.1944 + }, + "refetch100": { + "time": 791.5, + "rstdev": 3.74, + "memory": 3252216, + "ratio": 2.0752 + }, + "arrays100": { + "time": 706.414, + "rstdev": 2.04, + "memory": 2950424, + "ratio": 2.8198 + }, + "eagerBelongsTo": { + "time": 2983.421, + "rstdev": 5.74, + "memory": 7212976, + "ratio": 3.5392 + }, + "eagerHasMany": { + "time": 3451.521, + "rstdev": 4.33, + "memory": 12877592, + "ratio": 3.1194 + }, + "lazyBelongsTo": { + "time": 4251.132, + "rstdev": 3.8, + "memory": 3322856, + "ratio": 2.1755 + }, + "allPosts": { + "time": 103703.264, + "rstdev": 2.57, + "memory": 39038976, + "ratio": 3.3691 + }, + "insert": { + "time": 55888.35, + "rstdev": 1.46, + "memory": 3124048, + "ratio": 3.4958 + }, + "insertGraph": { + "time": 39078.645, + "rstdev": 1.22, + "memory": 3272712, + "ratio": 1.8427 + }, + "update": { + "time": 58167.091, + "rstdev": 1.21, + "memory": 3318440, + "ratio": 3.7996 + }, + "delete": { + "time": 53599.303, + "rstdev": 1.46, + "memory": 3182968, + "ratio": 3.9002 + } + }, + "doctrine": { + "findByPk": { + "time": 350.56, + "rstdev": 2.61, + "memory": 8013216, + "ratio": 2.3406 + }, + "list10": { + "time": 506.534, + "rstdev": 1.27, + "memory": 8012448, + "ratio": 2.4522 + }, + "list100": { + "time": 1418.559, + "rstdev": 1.98, + "memory": 10866880, + "ratio": 3.7632 + }, + "list1000": { + "time": 9868.792, + "rstdev": 3.96, + "memory": 12353696, + "ratio": 3.6889 + }, + "refetch100": { + "time": 986.827, + "rstdev": 4.01, + "memory": 7389320, + "ratio": 2.5873 + }, + "arrays100": { + "time": 792.974, + "rstdev": 2.51, + "memory": 4172824, + "ratio": 3.1653 + }, + "eagerBelongsTo": { + "time": 2226.228, + "rstdev": 6.49, + "memory": 7471464, + "ratio": 2.6409 + }, + "eagerHasMany": { + "time": 3425.01, + "rstdev": 3.01, + "memory": 12003624, + "ratio": 3.0955 + }, + "lazyBelongsTo": { + "time": 5057.041, + "rstdev": 2.37, + "memory": 7447808, + "ratio": 2.5879 + }, + "allPosts": { + "time": 101230.89, + "rstdev": 4.61, + "memory": 23195136, + "ratio": 3.2888 + }, + "insert": { + "time": 38713.69, + "rstdev": 1.61, + "memory": 4524184, + "ratio": 2.4215 + }, + "insertGraph": { + "time": 49862.584, + "rstdev": 1.02, + "memory": 4079304, + "ratio": 2.3512 + }, + "update": { + "time": 27007.913, + "rstdev": 1.93, + "memory": 7378928, + "ratio": 1.7642 + }, + "delete": { + "time": 24173.252, + "rstdev": 1.08, + "memory": 7448544, + "ratio": 1.759 + } + }, + "eloquent": { + "findByPk": { + "time": 655.09, + "rstdev": 1.33, + "memory": 4529552, + "ratio": 4.3739 + }, + "list10": { + "time": 760.675, + "rstdev": 2.15, + "memory": 4535080, + "ratio": 3.6825 + }, + "list100": { + "time": 1771.633, + "rstdev": 3.7, + "memory": 4588440, + "ratio": 4.6999 + }, + "list1000": { + "time": 7623.719, + "rstdev": 7.46, + "memory": 3989144, + "ratio": 2.8497 + }, + "refetch100": { + "time": 1759.601, + "rstdev": 2.99, + "memory": 4588440, + "ratio": 4.6134 + }, + "arrays100": { + "time": 987.323, + "rstdev": 6.91, + "memory": 4460840, + "ratio": 3.9411 + }, + "eagerBelongsTo": { + "time": 3914.557, + "rstdev": 2.68, + "memory": 4806120, + "ratio": 4.6438 + }, + "eagerHasMany": { + "time": 4430.847, + "rstdev": 3.27, + "memory": 4831872, + "ratio": 4.0045 + }, + "lazyBelongsTo": { + "time": 61366.293, + "rstdev": 0.75, + "memory": 5033208, + "ratio": 31.4036 + }, + "allPosts": { + "time": 86264.836, + "rstdev": 3.26, + "memory": 22933864, + "ratio": 2.8026 + }, + "insert": { + "time": 61199.223, + "rstdev": 1.26, + "memory": 5060224, + "ratio": 3.828 + }, + "insertGraph": { + "time": 77828.514, + "rstdev": 0.66, + "memory": 5547192, + "ratio": 3.6699 + }, + "update": { + "time": 61349.604, + "rstdev": 1.16, + "memory": 4593120, + "ratio": 4.0075 + }, + "delete": { + "time": 53080.45, + "rstdev": 0.49, + "memory": 4617288, + "ratio": 3.8625 + } + }, + "yii": { + "findByPk": { + "time": 553.359, + "rstdev": 1.56, + "memory": 2494232, + "ratio": 3.6947 + }, + "list10": { + "time": 628.494, + "rstdev": 2.28, + "memory": 2492384, + "ratio": 3.0426 + }, + "list100": { + "time": 1133.745, + "rstdev": 4.55, + "memory": 2492384, + "ratio": 3.0077 + }, + "list1000": { + "time": 4952.361, + "rstdev": 4.99, + "memory": 2880504, + "ratio": 1.8512 + }, + "refetch100": { + "time": 1162.811, + "rstdev": 4.81, + "memory": 2492384, + "ratio": 3.0487 + }, + "arrays100": { + "time": 1101.345, + "rstdev": 3.42, + "memory": 2492384, + "ratio": 4.3962 + }, + "eagerBelongsTo": { + "time": 2261.542, + "rstdev": 6.99, + "memory": 2996216, + "ratio": 2.6828 + }, + "eagerHasMany": { + "time": 2792.126, + "rstdev": 3.54, + "memory": 2857392, + "ratio": 2.5235 + }, + "lazyBelongsTo": { + "time": 52518.415, + "rstdev": 0.46, + "memory": 3022176, + "ratio": 26.8758 + }, + "allPosts": { + "time": 61414.843, + "rstdev": 2.81, + "memory": 18998160, + "ratio": 1.9953 + }, + "insert": { + "time": 50442.881, + "rstdev": 1.27, + "memory": 2227824, + "ratio": 3.1552 + }, + "insertGraph": { + "time": 62459.086, + "rstdev": 1.11, + "memory": 2235352, + "ratio": 2.9452 + }, + "update": { + "time": 51055.273, + "rstdev": 1.32, + "memory": 2559704, + "ratio": 3.3351 + }, + "delete": { + "time": 46576.252, + "rstdev": 1.74, + "memory": 2483208, + "ratio": 3.3892 + } + } + } + }, + { + "id": "mysql", + "label": "MySQL", + "server": "MySQL 8.4.13", + "date": "2026-12-02T09:06:46+00:00", + "machine": { + "cpu": "Intel(R) Xeon(R) 6975P-C", + "cores": 4, + "os": "Linux 7.0.0-1018-aws", + "runner": "ubuntu24 20261122.23.1", + "php": "8.5.13" + }, + "baseline": { + "findByPk": { + "time": 62.532, + "memory": 780088, + "runs": 5 + }, + "list10": { + "time": 75.696, + "memory": 780600, + "runs": 5 + }, + "list100": { + "time": 196.891, + "memory": 807736, + "runs": 5 + }, + "list1000": { + "time": 1577.383, + "memory": 1748792, + "runs": 5 + }, + "refetch100": { + "time": 236.846, + "memory": 807736, + "runs": 5 + }, + "arrays100": { + "time": 138.044, + "memory": 685208, + "runs": 5 + }, + "eagerBelongsTo": { + "time": 349.519, + "memory": 1208504, + "runs": 5 + }, + "eagerHasMany": { + "time": 703.891, + "memory": 10698968, + "runs": 5 + }, + "lazyBelongsTo": { + "time": 908.709, + "memory": 907024, + "runs": 5 + }, + "allPosts": { + "time": 14379.033, + "memory": 17519624, + "runs": 5 + }, + "insert": { + "time": 6489.188, + "memory": 802120, + "runs": 5 + }, + "insertGraph": { + "time": 8867.483, + "memory": 2074816, + "runs": 5 + }, + "update": { + "time": 7881.481, + "memory": 839296, + "runs": 5 + }, + "delete": { + "time": 7073.208, + "memory": 852768, + "runs": 5 + } + }, + "results": { + "cycle-mapper": { + "findByPk": { + "time": 132.896, + "rstdev": 11.82, + "memory": 2919752, + "ratio": 2.1252 + }, + "list10": { + "time": 232.302, + "rstdev": 7.44, + "memory": 2914296, + "ratio": 3.0689 + }, + "list100": { + "time": 749.441, + "rstdev": 7.76, + "memory": 2978392, + "ratio": 3.8064 + }, + "list1000": { + "time": 4674.69, + "rstdev": 1.32, + "memory": 4570664, + "ratio": 2.9636 + }, + "refetch100": { + "time": 486.755, + "rstdev": 8.11, + "memory": 3171488, + "ratio": 2.0552 + }, + "arrays100": { + "time": 450.615, + "rstdev": 9.24, + "memory": 2910200, + "ratio": 3.2643 + }, + "eagerBelongsTo": { + "time": 1775.213, + "rstdev": 3.57, + "memory": 7111288, + "ratio": 5.079 + }, + "eagerHasMany": { + "time": 2371.988, + "rstdev": 2.24, + "memory": 19126712, + "ratio": 3.3698 + }, + "lazyBelongsTo": { + "time": 2186.641, + "rstdev": 4.48, + "memory": 3227000, + "ratio": 2.4063 + }, + "allPosts": { + "time": 49106.266, + "rstdev": 2.93, + "memory": 35460536, + "ratio": 3.4151 + }, + "insert": { + "time": 10721.707, + "rstdev": 1.73, + "memory": 3173056, + "ratio": 1.6522 + }, + "insertGraph": { + "time": 14929.595, + "rstdev": 1.26, + "memory": 3512288, + "ratio": 1.6836 + }, + "update": { + "time": 15392.162, + "rstdev": 2.09, + "memory": 3474176, + "ratio": 1.953 + }, + "delete": { + "time": 11718.465, + "rstdev": 2.26, + "memory": 3256240, + "ratio": 1.6567 + } + }, + "cycle-ar": { + "findByPk": { + "time": 161.243, + "rstdev": 7.65, + "memory": 3000112, + "ratio": 2.5786 + }, + "list10": { + "time": 253.112, + "rstdev": 6.21, + "memory": 2994656, + "ratio": 3.3438 + }, + "list100": { + "time": 890.909, + "rstdev": 5.75, + "memory": 3085664, + "ratio": 4.5249 + }, + "list1000": { + "time": 5406.053, + "rstdev": 2.15, + "memory": 4944736, + "ratio": 3.4272 + }, + "refetch100": { + "time": 480.527, + "rstdev": 6.28, + "memory": 3287848, + "ratio": 2.0289 + }, + "arrays100": { + "time": 441.615, + "rstdev": 6.52, + "memory": 2920520, + "ratio": 3.1991 + }, + "eagerBelongsTo": { + "time": 1873.638, + "rstdev": 4.8, + "memory": 7500104, + "ratio": 5.3606 + }, + "eagerHasMany": { + "time": 2462.577, + "rstdev": 3.78, + "memory": 12804280, + "ratio": 3.4985 + }, + "lazyBelongsTo": { + "time": 2316.866, + "rstdev": 5.35, + "memory": 3357664, + "ratio": 2.5496 + }, + "allPosts": { + "time": 55253.16, + "rstdev": 0.8, + "memory": 39074608, + "ratio": 3.8426 + }, + "insert": { + "time": 29205.191, + "rstdev": 2.8, + "memory": 3173952, + "ratio": 4.5006 + }, + "insertGraph": { + "time": 21000.882, + "rstdev": 2.54, + "memory": 3306504, + "ratio": 2.3683 + }, + "update": { + "time": 35462.509, + "rstdev": 1.88, + "memory": 3286760, + "ratio": 4.4995 + }, + "delete": { + "time": 28953.265, + "rstdev": 2.31, + "memory": 3153632, + "ratio": 4.0934 + } + }, + "doctrine": { + "findByPk": { + "time": 144.383, + "rstdev": 6.71, + "memory": 7334528, + "ratio": 2.3089 + }, + "list10": { + "time": 270.91, + "rstdev": 6.29, + "memory": 7498296, + "ratio": 3.5789 + }, + "list100": { + "time": 868.653, + "rstdev": 6.19, + "memory": 11063384, + "ratio": 4.4118 + }, + "list1000": { + "time": 5546.536, + "rstdev": 7.97, + "memory": 12852384, + "ratio": 3.5163 + }, + "refetch100": { + "time": 583.936, + "rstdev": 6.27, + "memory": 7443584, + "ratio": 2.4655 + }, + "arrays100": { + "time": 497.934, + "rstdev": 6.93, + "memory": 4228696, + "ratio": 3.6071 + }, + "eagerBelongsTo": { + "time": 1209.412, + "rstdev": 1.82, + "memory": 7540672, + "ratio": 3.4602 + }, + "eagerHasMany": { + "time": 2017.817, + "rstdev": 2.37, + "memory": 12340656, + "ratio": 2.8667 + }, + "lazyBelongsTo": { + "time": 2534.127, + "rstdev": 4.91, + "memory": 7520064, + "ratio": 2.7887 + }, + "allPosts": { + "time": 54535.546, + "rstdev": 1.29, + "memory": 26568616, + "ratio": 3.7927 + }, + "insert": { + "time": 9335.31, + "rstdev": 1.78, + "memory": 4708864, + "ratio": 1.4386 + }, + "insertGraph": { + "time": 11972.037, + "rstdev": 3.59, + "memory": 4116848, + "ratio": 1.3501 + }, + "update": { + "time": 10290.678, + "rstdev": 2.81, + "memory": 7509848, + "ratio": 1.3057 + }, + "delete": { + "time": 9612.907, + "rstdev": 2.1, + "memory": 7520424, + "ratio": 1.3591 + } + }, + "eloquent": { + "findByPk": { + "time": 235.697, + "rstdev": 4.36, + "memory": 4566320, + "ratio": 3.7692 + }, + "list10": { + "time": 353.562, + "rstdev": 3.71, + "memory": 4571848, + "ratio": 4.6708 + }, + "list100": { + "time": 997.945, + "rstdev": 5.05, + "memory": 4625208, + "ratio": 5.0685 + }, + "list1000": { + "time": 4346.637, + "rstdev": 1.85, + "memory": 4032304, + "ratio": 2.7556 + }, + "refetch100": { + "time": 994.227, + "rstdev": 4.85, + "memory": 4625208, + "ratio": 4.1978 + }, + "arrays100": { + "time": 461.513, + "rstdev": 7.01, + "memory": 4497736, + "ratio": 3.3432 + }, + "eagerBelongsTo": { + "time": 2301.193, + "rstdev": 4.19, + "memory": 4842848, + "ratio": 6.5839 + }, + "eagerHasMany": { + "time": 2831.508, + "rstdev": 4.29, + "memory": 4868472, + "ratio": 4.0227 + }, + "lazyBelongsTo": { + "time": 20452.466, + "rstdev": 2.41, + "memory": 5063504, + "ratio": 22.5072 + }, + "allPosts": { + "time": 41974.689, + "rstdev": 0.97, + "memory": 22970592, + "ratio": 2.9192 + }, + "insert": { + "time": 25311.828, + "rstdev": 2.0, + "memory": 5096992, + "ratio": 3.9006 + }, + "insertGraph": { + "time": 33858.663, + "rstdev": 1.88, + "memory": 5583960, + "ratio": 3.8183 + }, + "update": { + "time": 26747.633, + "rstdev": 1.67, + "memory": 4345920, + "ratio": 3.3937 + }, + "delete": { + "time": 20458.805, + "rstdev": 1.44, + "memory": 3334328, + "ratio": 2.8924 + } + }, + "yii": { + "findByPk": { + "time": 143.492, + "rstdev": 7.5, + "memory": 2525912, + "ratio": 2.2947 + }, + "list10": { + "time": 195.52, + "rstdev": 8.17, + "memory": 2524064, + "ratio": 2.583 + }, + "list100": { + "time": 528.618, + "rstdev": 6.58, + "memory": 2524064, + "ratio": 2.6848 + }, + "list1000": { + "time": 2656.336, + "rstdev": 4.17, + "memory": 2826456, + "ratio": 1.684 + }, + "refetch100": { + "time": 534.775, + "rstdev": 4.76, + "memory": 2524064, + "ratio": 2.2579 + }, + "arrays100": { + "time": 548.848, + "rstdev": 11.22, + "memory": 2524064, + "ratio": 3.9759 + }, + "eagerBelongsTo": { + "time": 1112.895, + "rstdev": 9.89, + "memory": 3030600, + "ratio": 3.1841 + }, + "eagerHasMany": { + "time": 1513.043, + "rstdev": 3.94, + "memory": 2886480, + "ratio": 2.1495 + }, + "lazyBelongsTo": { + "time": 9140.918, + "rstdev": 5.4, + "memory": 3032168, + "ratio": 10.0592 + }, + "allPosts": { + "time": 28516.2, + "rstdev": 2.96, + "memory": 19825824, + "ratio": 1.9832 + }, + "insert": { + "time": 9690.927, + "rstdev": 3.68, + "memory": 2259560, + "ratio": 1.4934 + }, + "insertGraph": { + "time": 12504.243, + "rstdev": 4.41, + "memory": 2267560, + "ratio": 1.4101 + }, + "update": { + "time": 11497.613, + "rstdev": 2.76, + "memory": 2493280, + "ratio": 1.4588 + }, + "delete": { + "time": 9167.972, + "rstdev": 2.11, + "memory": 2513696, + "ratio": 1.2962 + } + } + } + } + ] +} From ea44a76b002a44d215055d2869f9bc95cb4dd62e Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 13:33:50 +0400 Subject: [PATCH 4/8] docs(benchmarks): explain the scenarios, draw PDO as a baseline - Hovering a scenario explains what it does and how it is measured; hovering a result shows its time, spread, ratio and peak memory. - The memory chart draws PDO as a dashed line through the bars. - The page lifts its width limit: tables take the width of their content, the prose keeps its reading width and the charts stop at 960px. Assisted-By: Claude Opus 5.5 --- .vitepress/theme/OrmBenchmarks.vue | 200 +++++++++++++++++++++++++---- .vitepress/theme/style.css | 11 +- 2 files changed, 185 insertions(+), 26 deletions(-) diff --git a/.vitepress/theme/OrmBenchmarks.vue b/.vitepress/theme/OrmBenchmarks.vue index 69005c8..5ddd239 100644 --- a/.vitepress/theme/OrmBenchmarks.vue +++ b/.vitepress/theme/OrmBenchmarks.vue @@ -5,6 +5,11 @@ import { data as runs, type Run, type ScenarioGroup } from './orm-benchmarks.dat const { lang } = useData() +function plural(n: number, one: string, few: string, many: string): string { + const d = n % 10, h = n % 100 + return d === 1 && h !== 11 ? one : d >= 2 && d <= 4 && (h < 12 || h > 14) ? few : many +} + const TEXT = { en: { empty: 'No published runs yet.', @@ -22,7 +27,7 @@ const TEXT = { summary: 'Overall', summaryHint: 'Geometric mean of the time relative to hand-written PDO across all scenarios. Lower is better.', matrix: 'Scenarios', - matrixHint: 'Hover a cell for the time per operation, its spread and the peak memory. The best result in each row is bold.', + matrixHint: 'Hover a scenario to see what it does, a cell for the time per operation, its spread and the peak memory. The best result in each row is bold.', relative: 'Relative to PDO', absolute: 'Time per operation', scenario: 'Scenario', @@ -37,8 +42,27 @@ const TEXT = { memoryHint: 'Peak memory of the process loading all 10 000 posts.', history: 'History', historyHint: 'The overall score of every published run on this database. Click a point to open the run.', + baseline: 'PDO baseline', + peak: 'Peak memory', + runs: (revs: number, iterations: number) => `${iterations} iterations of ${revs} ${revs === 1 ? 'operation' : 'operations'}, each iteration in a fresh process.`, groups: { read: 'Reads', relations: 'Relations', bulk: 'Bulk', write: 'Writes' } as Record, scenarios: {} as Record, + help: { + findByPk: 'Loads one user by its primary key, starting from an empty identity map.', + list10: 'Loads the first 10 users as entities, starting from an empty identity map.', + list100: 'Loads the first 100 users as entities, starting from an empty identity map.', + list1000: 'Loads all 1000 users as entities: shows the cost of hydration per row.', + refetch100: 'Loads the same 100 users again while they are still in the identity map. ORMs that have one reuse the entities instead of building them again.', + arrays100: 'Loads 100 users through the ORM query builder as plain arrays, without entities: the cost of the query layer alone.', + eagerBelongsTo: 'Loads 100 posts together with their authors (10 distinct users) in advance, then reads the name of each author.', + eagerHasMany: 'Loads 20 users together with all their posts in advance: 200 posts.', + lazyBelongsTo: 'Loads 100 posts, then reaches each author through a lazy reference: 10 users loaded on demand.', + allPosts: 'Loads all 10 000 posts as entities at once. The memory chart below shows the peak memory of this scenario.', + insert: 'Creates 100 users and saves them. Writes run in a transaction that is rolled back.', + insertGraph: 'Creates 20 users with 5 posts each and saves them together: the ORM orders the inserts and fills in the foreign keys.', + update: 'Loads 100 users, changes the name of each and saves them: 100 UPDATE statements.', + delete: 'Loads 100 posts and deletes them one by one.', + } as Record, }, ru: { empty: 'Опубликованных прогонов пока нет.', @@ -56,7 +80,7 @@ const TEXT = { summary: 'Итог', summaryHint: 'Среднее геометрическое времени относительно ручного PDO по всем сценариям. Меньше — лучше.', matrix: 'Сценарии', - matrixHint: 'При наведении на ячейку видно время операции, разброс и пик памяти. Лучший результат в строке выделен.', + matrixHint: 'Наведите на сценарий, чтобы узнать, что он делает, на ячейку — чтобы увидеть время операции, разброс и пик памяти. Лучший результат в строке выделен.', relative: 'Относительно PDO', absolute: 'Время операции', scenario: 'Сценарий', @@ -71,7 +95,26 @@ const TEXT = { memoryHint: 'Пик памяти процесса, загружающего все 10 000 постов.', history: 'История', historyHint: 'Итоговая оценка каждого опубликованного прогона на этой базе. Клик по точке открывает прогон.', + baseline: 'Базовый PDO', + peak: 'Пик памяти', + runs: (revs: number, iterations: number) => `${iterations} ${plural(iterations, 'итерация', 'итерации', 'итераций')} по ${revs} ${plural(revs, 'операции', 'операции', 'операций')}, каждая итерация в новом процессе.`, groups: { read: 'Чтение', relations: 'Связи', bulk: 'Массовая загрузка', write: 'Запись' } as Record, + help: { + findByPk: 'Загружает одного пользователя по первичному ключу, identity map перед этим пустая.', + list10: 'Загружает первых 10 пользователей сущностями, identity map перед этим пустая.', + list100: 'Загружает первых 100 пользователей сущностями, identity map перед этим пустая.', + list1000: 'Загружает всех 1000 пользователей сущностями: видна цена гидрации одной строки.', + refetch100: 'Загружает тех же 100 пользователей ещё раз, пока они лежат в identity map. ORM, у которых она есть, берут готовые сущности, а не собирают их заново.', + arrays100: 'Загружает 100 пользователей через построитель запросов ORM простыми массивами, без сущностей: цена одного слоя запросов.', + eagerBelongsTo: 'Загружает 100 постов сразу вместе с авторами (10 разных пользователей) и читает имя каждого автора.', + eagerHasMany: 'Загружает 20 пользователей сразу со всеми их постами: 200 постов.', + lazyBelongsTo: 'Загружает 100 постов, а авторов достаёт через ленивую ссылку: 10 пользователей подгружаются по требованию.', + allPosts: 'Загружает все 10 000 постов сущностями за раз. График памяти ниже показывает пик памяти в этом сценарии.', + insert: 'Создаёт и сохраняет 100 пользователей. Запись идёт в транзакции, которая потом откатывается.', + insertGraph: 'Создаёт 20 пользователей по 5 постов и сохраняет всё вместе: ORM сама упорядочивает вставки и проставляет внешние ключи.', + update: 'Загружает 100 пользователей, меняет каждому имя и сохраняет: 100 запросов UPDATE.', + delete: 'Загружает 100 постов и удаляет их по одному.', + } as Record, scenarios: { findByPk: 'Поиск по первичному ключу', list10: 'Список из 10 строк', @@ -160,7 +203,10 @@ function cell(scenario: string, contender: string) { ...m, best: m.ratio === best, style: { background: `hsla(${Math.round(130 - 130 * k)}, 65%, 50%, 0.16)` }, - title: `${formatTime(m.time)} ± ${m.rstdev.toFixed(1)}%, ${formatBytes(m.memory)}`, + lines: [ + `${formatTime(m.time)} ± ${m.rstdev.toFixed(1)}% · ${m.ratio.toFixed(2)}× PDO`, + `${t.value.peak}: ${formatBytes(m.memory)}`, + ], } } @@ -190,16 +236,34 @@ watch(contenders, list => { list.some(c => c.id === across.value) || (across.value = list[0]?.id ?? '') }, { immediate: true }) +// PDO is not a bar but the baseline line across the bars. const memory = computed(() => { - if (!db.value) return [] - const rows = [ - { id: 'pdo', label: 'PDO', bytes: db.value.baseline.allPosts?.memory ?? 0 }, - ...contenders.value.map(c => ({ id: c.id, label: c.label, bytes: db.value!.results[c.id].allPosts?.memory ?? 0 })), - ].filter(r => r.bytes > 0) - const max = Math.max(...rows.map(r => r.bytes)) - return rows.map(r => ({ ...r, width: (r.bytes / max) * 100 })) + const pdo = db.value?.baseline.allPosts?.memory ?? 0 + const rows = contenders.value + .map(c => ({ id: c.id, label: c.label, bytes: db.value?.results[c.id].allPosts?.memory ?? 0 })) + .filter(r => r.bytes > 0) + const max = Math.max(pdo, ...rows.map(r => r.bytes)) + return { + rows: rows.map(r => ({ ...r, width: (r.bytes / max) * 100 })), + baseline: pdo > 0 ? { bytes: pdo, at: (pdo / max) * 100 } : null, + } }) +// One tooltip for the whole component, placed next to the hovered element; `title` is slow and unstyled. +const tip = ref<{ title: string, lines: string[], x: number, y: number, below: boolean } | null>(null) +function showTip(event: MouseEvent | FocusEvent, title: string, ...lines: string[]) { + const rect = (event.currentTarget as HTMLElement).getBoundingClientRect() + const below = rect.top < 160 + tip.value = { title, lines: lines.filter(Boolean), x: rect.left + rect.width / 2, y: below ? rect.bottom + 8 : rect.top - 8, below } +} +function hideTip() { + tip.value = null +} +const scenarioHelp = (s: Run['scenarios'][number]) => [ + t.value.help[s.id] ?? '', + t.value.runs(s.revs, s.iterations), +] + const versionChanges = computed(() => { const before = new Map(previous.value?.contenders.map(c => [c.id, c.version]) ?? []) return contenders.value.map(c => ({ ...c, was: before.has(c.id) && before.get(c.id) !== c.version ? before.get(c.id) : null })) @@ -343,7 +407,7 @@ const repoUrl = computed(() => `https://github.com/${run.value?.source.repositor {{ t.groups[g.group] }} - {{ scenarioLabel(s) }} + {{ scenarioLabel(s) }} {{ formatTime(db.baseline[s.id].time) }} `https://github.com/${run.value?.source.repositor class="num" :class="{ best: cell(s.id, c.id).best }" :style="cell(s.id, c.id).style" - :title="cell(s.id, c.id).title" + @mouseenter="showTip($event, `${label(c.id)} · ${scenarioLabel(s)}`, ...cell(s.id, c.id).lines)" + @mouseleave="hideTip" > {{ mode === 'relative' ? `${cell(s.id, c.id).ratio.toFixed(1)}×` : formatTime(cell(s.id, c.id).time) }} @@ -401,8 +466,8 @@ const repoUrl = computed(() => `https://github.com/${run.value?.source.repositor - {{ scenarioLabel(s) }} - + {{ scenarioLabel(s) }} + {{ d.results[across][s.id].ratio.toFixed(1) }}× @@ -411,13 +476,16 @@ const repoUrl = computed(() => `https://github.com/${run.value?.source.repositor - + + + + @@ -570,19 +651,90 @@ button.active { border-bottom-color: var(--vp-c-brand-1); } +/* Charts don't grow with the wide page: past this width the bars stop being comparable at a glance. */ +.bars, +.duel, +.duel-pick, +.chart, +.legend { + max-width: 960px; +} + .bars { + --label: 170px; + --value: 80px; + --gap: 12px; display: grid; gap: 6px; } .bar-row { display: grid; - grid-template-columns: 170px 1fr 80px; - gap: 12px; + grid-template-columns: var(--label) 1fr var(--value); + gap: var(--gap); align-items: center; font-size: 14px; } +.with-baseline { + position: relative; + padding-top: 26px; +} + +/* A dashed line through every bar at the PDO value: `--at` is its share of the track. */ +.baseline { + position: absolute; + top: 0; + bottom: -4px; + left: calc(var(--label) + var(--gap) + (100% - var(--label) - var(--value) - 2 * var(--gap)) * var(--at)); + border-left: 2px dashed var(--vp-c-text-2); + pointer-events: none; + z-index: 1; +} + +.baseline-label { + position: absolute; + top: 0; + left: 6px; + white-space: nowrap; + font-size: 12px; + line-height: 18px; + color: var(--vp-c-text-2); +} + +.has-tip { + cursor: help; + text-decoration: underline dotted var(--vp-c-text-3); + text-underline-offset: 4px; +} + +.orm-bench-tip { + position: fixed; + z-index: 100; + max-width: 340px; + transform: translate(-50%, -100%); + display: flex; + flex-direction: column; + gap: 4px; + padding: 10px 14px; + border: 1px solid var(--vp-c-divider); + border-radius: 8px; + background: var(--vp-c-bg-elv); + box-shadow: var(--vp-shadow-3); + color: var(--vp-c-text-2); + font-size: 13px; + line-height: 1.5; + pointer-events: none; +} + +.orm-bench-tip.below { + transform: translate(-50%, 0); +} + +.orm-bench-tip strong { + color: var(--vp-c-text-1); +} + .bar-track { height: 14px; } @@ -605,9 +757,10 @@ button.active { margin-top: 12px; } +/* As wide as the content: the page lifts its width limit, and a narrow screen scrolls the table instead. */ .matrix { display: table; - width: 100%; + width: auto; margin: 0; font-size: 14px; } @@ -726,8 +879,9 @@ button.active { } @media (max-width: 640px) { - .bar-row { - grid-template-columns: 110px 1fr 64px; + .bars { + --label: 110px; + --value: 64px; } .duel-row { diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index 4b55fd3..af07047 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -1363,8 +1363,13 @@ a.featured-post-card:hover { gap: 12px; } -/* The ORM benchmarks page: wide tables, no outline. */ +/* The ORM benchmarks page: the tables take the width they need, up to the whole space next to the sidebar; the prose keeps its reading width. */ .orm-bench-page .VPDoc .container, -.orm-bench-page .VPDoc .content { - max-width: 1152px; +.orm-bench-page .VPDoc .content, +.orm-bench-page .VPDoc .content-container { + max-width: none; +} + +.orm-bench-page .vp-doc > div > :not(.orm-bench) { + max-width: 784px; } From 33856aebd2a6c47e419672bb50959f9e7efe9e62 Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 14:02:10 +0400 Subject: [PATCH 5/8] docs(benchmarks): let the tables use the whole width of the page The site caps the doc content at 900px with !important, and past 1440px VitePress centers the layout: both kept the tables narrow. Assisted-By: Claude Opus 5.5 --- .vitepress/theme/style.css | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.vitepress/theme/style.css b/.vitepress/theme/style.css index af07047..4b99a7d 100644 --- a/.vitepress/theme/style.css +++ b/.vitepress/theme/style.css @@ -1363,11 +1363,19 @@ a.featured-post-card:hover { gap: 12px; } -/* The ORM benchmarks page: the tables take the width they need, up to the whole space next to the sidebar; the prose keeps its reading width. */ +/* The ORM benchmarks page: the tables take the width they need, up to the whole space next to the sidebar; the prose + keeps its reading width. `!important` beats the doc widths above. */ .orm-bench-page .VPDoc .container, .orm-bench-page .VPDoc .content, .orm-bench-page .VPDoc .content-container { - max-width: none; + max-width: none !important; +} + +/* Past 1440px VitePress centers the layout in --vp-layout-max-width: give the right side to the tables. */ +@media (min-width: 1440px) { + .orm-bench-page .VPContent.has-sidebar { + padding-right: 0 !important; + } } .orm-bench-page .vp-doc > div > :not(.orm-bench) { From 658eb3549a9f9127c36c41a331cd59d1f6cb7d1c Mon Sep 17 00:00:00 2001 From: roxblnfk Date: Wed, 2 Dec 2026 14:04:13 +0400 Subject: [PATCH 6/8] docs(benchmarks): open a table over the whole screen instead of widening the page The page keeps the width of the other docs; each table gets an Expand button that lays it over the page at the width of its content. Esc or the button closes it. Assisted-By: Claude Opus 5.5 --- .vitepress/theme/OrmBenchmarks.vue | 61 ++++++++++++++++++++++++++++-- .vitepress/theme/style.css | 19 ---------- benchmarks/orm.md | 1 - ru/benchmarks/orm.md | 1 - 4 files changed, 57 insertions(+), 25 deletions(-) diff --git a/.vitepress/theme/OrmBenchmarks.vue b/.vitepress/theme/OrmBenchmarks.vue index 5ddd239..f181e46 100644 --- a/.vitepress/theme/OrmBenchmarks.vue +++ b/.vitepress/theme/OrmBenchmarks.vue @@ -1,5 +1,5 @@