ffi: add getFunction cache-miss benchmark - #66456
Open
HoonDongKang wants to merge 1 commit into
Open
HoonDongKang wants to merge 1 commit into
HoonDongKang wants to merge 1 commit into
Conversation
The existing get-function benchmark reuses the callable cached during warmup, so it no longer measures trampoline creation. Add a cache-miss benchmark that resolves a function once per library instance. Construct the instances before timing to exclude library loading while including symbol resolution, signature preparation, and callable creation. Update the existing benchmark comments to describe cache-hit lookups. Signed-off-by: HoonDongKang <d159123@naver.com> Assisted-by: Codex:Astra-medium
Collaborator
|
Review requested:
|
addaleax
approved these changes
Oct 2, 2026
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.
The comments in
get-function.js, added in #64969, describe measuring trampoline creation. However, callable caching introduced in #64971 causes the measured loop to reuse the callable created during warmup, so those comments no longer reflect what the benchmark measures.Add a cache-miss benchmark to cover first-time function resolution, including trampoline creation.
Add
get-function-cache-miss.jsto measure the firstgetFunction()call on each library instance. Instances are created before timing, and warmup uses a separate instance to leave the measured caches empty. This includes symbol resolution, signature preparation, and callable creation.Update the existing benchmark comments to describe cache-hit lookups.
Results from 30 runs per signature, measuring cache-hit and cache-miss paths:
get-function.js)get-function.js)get-function-cache-miss.js)get-function-cache-miss.js)Refs: #64969
Refs: #64971
Assisted-by: Codex:Astra-medium