Repository navigation
Benchmark framework hot paths and accelerate HTML rendering - #34
Merged
Merged
Conversation
zth
marked this pull request as ready for review
September 22, 2026 07:02
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reduce allocation and promise overhead in buffered HTML rendering while preserving escaping, deferred component execution and request-context isolation.
Changes
h(). Avoid extra promise coordination for synchronous trees and single async subtrees.Final direct measurements against main
Baseline
9dd19d2693e82d2f979c8d54fe682237d78b72ae; candidate implementation5bbd562a235c59a75c726030c74835d8c74bc681(framework source hashes matched the delivered implementation). Bun 1.3.14, Linux x64, AMD RYZEN AI MAX+ 395, shared development host. Each workload/version ran in a fresh process: one second warmup, nine approximately 60 ms samples, three alternating baseline/candidate pairs. Values are medians of process medians. These are direct comparisons, not multiplied optimization-round ratios.The complete page request takes 29.5% less time (1.42× speedup). Requests include Request creation, framework processing and Response.text(), without sockets, TLS or a database. These figures do not predict equivalent production HTTP throughput gains.
Escaping-heavy text and attributes are essentially unchanged. Minimal requests improve only 6%, with overlapping process ranges. AsyncLocalStorage is unchanged and its controls measured slightly slower; no ALS improvement is claimed. Raw HTML's 14.21× ratio saves only about 19 ns and is susceptible to JIT elimination, so it is not a useful application speedup claim. UTF-8 materialization narrows rendering gains to 1.16×. Streaming performance was excluded.
Dedicated JSX entry points and synchronous fast paths were informed by KitaJS, Hono and Preact source implementations. No weaker escaping or eager component execution was adopted. A generic variadic-factory rewrite was discarded after regressions.
Validation
0908cb9: 120 tests passed, 0 failures, 310 assertions locally. ReScript build and all benchmark smoke cases passed. GitHub CI is green on the same commit.The retained benchmark fixtures verify expected output before and after measurement; tests exercise them twice. Renderer and request regressions cover promise ordering/rejection, provider scope, concurrent requests, legacy JSX, immutable compiler props, numeric zero, headers, lazy collections and route behavior. CI builds ReScript, runs the full tests and runs benchmark smoke. Measurement history is retained only in this PR discussion, not the merge diff.