Skip to content

Speed up component rendering and eager loading - #2758

Merged
joelhawksley merged 1 commit into
mainfrom
joelhawksley-benchmark-optimization
Oct 29, 2026
Merged

joelhawksley merged 1 commit into
mainfrom
joelhawksley-benchmark-optimization

Conversation

@joelhawksley

Copy link
Copy Markdown
Member

Share indexed sidecar directory listings during eager loading and replace the per-render state-reset loop with direct checks. Both changes target hot paths identified with Vernier; benchmark workloads are unchanged.

Three paired runs, 15 passes each, on Rails 8.1.4 and Ruby 4.1-dev:

Scenario Before After Time reduction
Component 76.25 µs 71.17 µs 6.7%
Inline call 74.01 µs 68.34 µs 7.7%
Inline ERB 67.86 µs 63.17 µs 6.9%
Slots 7.83 µs 7.45 µs 4.8%
Collection 60.08 µs 55.30 µs 8.0%
Boot—ViewComponent portion 1,993 ms 741 ms 62.8%

Runtime allocations are unchanged. Boot allocations increase approximately 2.3% for the temporary index, which is discarded after eager loading.

@joelhawksley
joelhawksley merged commit 6d15620 into main Oct 29, 2026
30 checks passed
@joelhawksley
joelhawksley deleted the joelhawksley-benchmark-optimization branch October 29, 2026 18:46
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