Skip to content

Send plain values straight to Base - #72

Merged
jho406 merged 1 commit into
mainfrom
shortcut-send-values
Oct 18, 2026
Merged

jho406 merged 1 commit into
mainfrom
shortcut-send-values

Conversation

@jho406

@jho406 jho406 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

A json.key value went through Template#set!, BaseWithExtensions#set! and Base#set!, each checking for a block or options it did not have. Those layers were the largest cost in a render outside of Oj, more so without YJIT where every call is paid in full.

Template#set! now hands a value with no block, that is not a Props::Options, to a new Base#set_value!, which writes it directly. Searcher#set_value! ignores it, as Searcher#set! already did for values. extract! uses set_value! too, and set_content! skips the extension lookups when there are no options.

A `json.key value` went through Template#set!, BaseWithExtensions#set!
and Base#set!, each checking for a block or options it did not have.
Those layers were the largest cost in a render outside of Oj, more so
without YJIT where every call is paid in full.

Template#set! now hands a value with no block, that is not a
Props::Options, to a new Base#set_value!, which writes it directly.
Searcher#set_value! ignores it, as Searcher#set! already did for values.
extract! uses set_value! too, and set_content! skips the extension
lookups when there are no options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jho406
jho406 merged commit 5cfd8f6 into main Oct 18, 2026
24 checks passed
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