Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: auto cache parsed bytecode for the first load. #280

Merged
merged 12 commits into from
Mar 30, 2023

Conversation

andycall
Copy link
Member

@andycall andycall commented Mar 12, 2023

This pull request allows for the export of QuickJS bytecode when evaluating JavaScript code for the first time, and saves it to disk. When the user subsequently opens the same URL and evaluates the same JavaScript code, WebF will load the corresponding bytecode from disk and directly interpret it, instead of parsing and running the code again.

This PR can save 80-90% of javascript load time.

JavaScript Code Size Parse + Eval Load Bytecode From Disk and Eval
876.94KB 221ms 2ms + 18ms
475.37KB 183ms 1ms + 30ms

@andycall andycall changed the base branch from main to fix/script_eval March 13, 2023 04:28
@andycall andycall changed the base branch from fix/script_eval to main March 27, 2023 08:25
@andycall andycall added this pull request to the merge queue Mar 30, 2023
Merged via the queue into main with commit 1f3832d Mar 30, 2023
andycall added a commit that referenced this pull request Apr 13, 2023
* fix: fix script execution order with inline script element.

* fix: fix script load phase.

* feat: Support caching bytecode parsed from JavaScript.

* feat: enable annotation codes.

* fix: fix test specs.

* feat: add switch to disable quickjs bytecode cache.

* Committing clang-format changes

---------

Co-authored-by: openwebf-bot <openwebf@openwebf.com>
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.

None yet

3 participants