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

Update goja #3339

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Update goja #3339

merged 1 commit into from
Sep 19, 2023

Conversation

mstoykov
Copy link
Contributor

@mstoykov mstoykov commented Sep 19, 2023

This updates makes the runtime initialization faster and lighter.

For empty and fairly small scripts the observed initialization improvement by some fast "benchmarking" for k6 this means:

  1. around 3x faster initialization of VUs
  2. around 4x less memory usage.

This likely will be nearly unnoticeable as this is only reasonably easy to see with 100k VUs for the initialization speed where it goes from around 10s to a little over 3s.

Adding more code increases both linearly, so bigger scripts will have some speed up, but it won't be 3x.

Same seems to be for memory usages as well.

Both of those likely get way worse if more and more of the JavaScript "standard library" is used as in that case all of those now templated properties will be used.

Changelog

internal: update goja with some runtime initialization speed-ups

The speed-ups are around 3x and there is 4x memory reduction for empty scripts. Anything more complex adds and using JS types or importing libraries decrease this as it just adds to the actual initialization in ways this optimization does not help.

@mstoykov mstoykov added this to the v0.47.0 milestone Sep 19, 2023
This updates makes the runtime initialization faster and *lighter*.

For empty and fairly small scripts the observed initialization
improvement by some fast "benchmarking" for k6 this means:
1. around 3x faster initialization of VUs
2. around 4x less memory usage.

This likely will be nearly unnoticeable as this is only reasonably easy
to see with 100k VUs for the initialization speed where it goes from
around 10s to a little over 3s.

Adding more code increases both linearly, so bigger scripts will have
some speed up but it won't be 3x.

Same seems to be for memory usages as well.

Both of those likely get way worse if more and more of the JavaScript
"standard library" is used as in that case all of those now templated
properties will be used.
@mstoykov mstoykov merged commit 5b50402 into master Sep 19, 2023
20 of 21 checks passed
@mstoykov mstoykov deleted the updateGoja branch September 19, 2023 15:20
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.

3 participants