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

Reuse the parsed core-js library across VUs #1038

Merged
merged 1 commit into from
Jun 3, 2019
Merged

Conversation

na--
Copy link
Member

@na-- na-- commented Jun 3, 2019

This PR caches the *goja.Program result from parsing the core-js library so we can reuse it across VUs. Thanks to @matlockx for suggesting this, despite my attempts to misunderstand it 😊

Brief performance comparisons on my laptop between this code and k6 v0.24.0 show an over 2x reduction of VU memory usage and initialization times when running the 2000 VU/empty script test from the StackOverflow question that started this whole investigation!

@na-- na-- requested a review from mstoykov June 3, 2019 08:57
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #1038 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1038      +/-   ##
==========================================
+ Coverage   72.67%   72.67%   +<.01%     
==========================================
  Files         133      133              
  Lines        9843     9846       +3     
==========================================
+ Hits         7153     7156       +3     
  Misses       2274     2274              
  Partials      416      416
Impacted Files Coverage Δ
js/lib/lib.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2999a1e...3e4a685. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jun 3, 2019

Codecov Report

Merging #1038 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1038      +/-   ##
==========================================
+ Coverage   72.67%   72.67%   +<.01%     
==========================================
  Files         133      133              
  Lines        9843     9846       +3     
==========================================
+ Hits         7153     7156       +3     
  Misses       2274     2274              
  Partials      416      416
Impacted Files Coverage Δ
js/lib/lib.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2999a1e...3e4a685. Read the comment docs.

@na-- na-- merged commit 0dd4262 into master Jun 3, 2019
@na-- na-- deleted the cache-parsed-core-js branch June 3, 2019 09:28
@na-- na-- restored the cache-parsed-core-js branch June 3, 2019 09:42
@na-- na-- deleted the cache-parsed-core-js branch June 3, 2019 10:30
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.

2 participants