Skip to content

[DRAFT] chore(LTRAC-633): add messageformat candidates benchmark script#429

Draft
bc-yevhenii-buliuk wants to merge 1 commit intomasterfrom
ltrac-633/performance-benchmark
Draft

[DRAFT] chore(LTRAC-633): add messageformat candidates benchmark script#429
bc-yevhenii-buliuk wants to merge 1 commit intomasterfrom
ltrac-633/performance-benchmark

Conversation

@bc-yevhenii-buliuk
Copy link
Copy Markdown

@bc-yevhenii-buliuk bc-yevhenii-buliuk commented May 6, 2026

What? Why?

This PR adds benchmark scripts and results to compare MF library candidates (current messageformat@0.3.1 (Current), @messageformat/icu-messageformat-1 (C1), intl-messageformat (C2), icu-minify (C3)) on realistic ICU strings from the Cornerstone theme.

What's included:

  • scripts/benchmark-mf.js + npm run benchmark:mf — measures three scenarios separately on 10 individual fixtures: compile-only, render-only (compile once per case, timed format only), and full compile+render per iteration.
  • scripts/benchmark-mf-cornerstone.js + npm run benchmark:mf-cornerstone — runs all three scenarios over the entire Cornerstone lang/en.json (778 strings per iteration), simulating a real full-page render cycle.
  • scripts/cornerstone-en.json — full Cornerstone translation file used by the Cornerstone benchmark.
  • docs/benchmark-mf-results.md — results tables and conclusions for all scenarios.

Why: isolating compile vs render costs matters because production caches the compiled handle within a request — so the hot path is render-only for repeated keys, while the first call per key pays the full cycle. CF Worker may additionally support pre-compiling at theme deploy time, making render-only the dominant scenario there.

How was it tested?

N/A

@bc-yevhenii-buliuk bc-yevhenii-buliuk force-pushed the ltrac-633/performance-benchmark branch from ae86787 to 39e4503 Compare May 7, 2026 18:53
@bc-yevhenii-buliuk bc-yevhenii-buliuk force-pushed the ltrac-633/performance-benchmark branch from 39e4503 to a8e9653 Compare May 7, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant