Speed up rendering and close a few compile-time holes - #32
Closed
gregjotau wants to merge 2 commits into
Closed
Conversation
Write ASCII and UTF-8 in a single pass through the output buffer, encode integers without the old divisor walk, and skip context-path concatenation when the path is empty. Golden pages and a reference encoder keep the bytes identical, including across tiny buffers.
failOnUnusedFragments now also fails unused fragment parameters. Hash targets on href, hx-target, hx-include, and hx-indicator must resolve to an id on the page. Spring renders through the same 16KiB HtmlOutput buffer as the rest of the runtime.
Contributor
Author
|
Closing as a stale, conflicted bundle rather than merging it wholesale. The safe unused-fragment-parameter part shipped in #46. The proposed static |
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.
Why
Render speed is now measured. The first pass over HtmlOutput was still
per-character with a flush check on every byte, integers walked a divisor,
and application-relative TrustedUrls allocated even when the context path
was empty. Spring also flushed a 1KiB buffer. A few dead-code and
reference checks were inconsistent with the rest of the compiler.
What
HtmlOutput.textand reverse-digittext(long)RenderContext.resolveUrlreturns the same string when the context path is emptyfailOnUnusedFragmentsalso fails unused fragment parameters#idtargets onhref/hx-target/hx-include/hx-indicatormust existHtmlOutputbuffer matches the 16KiB runtime defaultLocal JMH: inbox ~1.55µs → ~1.02µs, catalog/50 ~5.4µs → ~3.7µs, integers ~1.0µs → ~0.43µs.
How to check
./gradlew test ./gradlew :benchmark:jmh