Repository navigation
modernc-quickjs: run pending jobs after evaluating a script - #41
Open
j-modernc-org wants to merge 1 commit into
Open
j-modernc-org wants to merge 1 commit into
j-modernc-org wants to merge 1 commit into
Conversation
This branch has not been deployed
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 modernc-quickjs runner evaluates each file but never runs the job
queue, so no promise reaction or async function continuation ever
executes. That is why every async/Promise compat-table test fails for
this engine (ES2017 async functions, ES2018 Promise.prototype.finally
and async iterators, ES2021 Promise.any), while the qjs shell of C
QuickJS, which runs its event loop, passes them.
This change drains the queue with VM.ExecutePendingJobs after each
evaluation, in file mode and in the REPL, as the qjs shell does. With
it, these print OK where they printed nothing before:
Separately, could the benchmarks for modernc-quickjs be re-run at some
point? The published numbers come from e0b6329 (v0.17.1-111,
2026-03-03). On the V8 suite v7, the core of Octane, the engine is now
1.8x (amd64) to 2.0x (arm64) faster than that revision:
Run on my amd64 machine, e0b6329 lands within 5% of the published amd64
numbers (Richards 132 vs 142, Splay 619 vs 682), so the comparison
should carry over to your runners.
Disclosure: I maintain modernc.org/quickjs.