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

Improve global object setup and access performance #1280

Merged
merged 10 commits into from Sep 3, 2022

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Sep 3, 2022

Going through GlobalEnvironmentRecord and optimizing it a bit. Biggest change is to remove ObjectEnvironmentRecord as intermediary abstraction for global access and replace with faster patterns.

@lahma

This comment was marked as outdated.

@lahma

This comment was marked as outdated.

@lahma
Copy link
Collaborator Author

lahma commented Sep 3, 2022

Esprima.Benchmark.SunSpiderBenchmark

Diff Method FileName Mean Error Allocated
Old Run 3d-cube 208.56 ms 1.151 ms 51123.86 KB
New 193.96 ms (-7%) 0.613 ms 50173.23 KB (-2%)
Old Run 3d-morph 158.67 ms 0.466 ms 49744.51 KB
New 158.57 ms (0%) 0.431 ms 48381.13 KB (-3%)
Old Run 3d-raytrace 165.48 ms 0.402 ms 93386.96 KB
New 170.51 ms (+3%) 0.309 ms 92704.3 KB (-1%)
Old Run access-binary-trees 85.50 ms 0.189 ms 78471.05 KB
New 83.33 ms (-3%) 0.179 ms 75722.18 KB (-4%)
Old Run access-fannkuch 450.41 ms 3.388 ms 135.64 KB
New 453.33 ms (+1%) 0.894 ms 134.92 KB (-1%)
Old Run access-nbody 188.00 ms 0.346 ms 63848.88 KB
New 191.20 ms (+2%) 0.355 ms 63844.97 KB (0%)
Old Run access-nsieve 159.94 ms 0.443 ms 21518.15 KB
New 155.83 ms (-3%) 0.322 ms 21518.29 KB (0%)
Old Run bitop(...)-byte [24] 157.57 ms 0.187 ms 68949.06 KB
New 157.90 ms (0%) 0.389 ms 68948.59 KB (0%)
Old Run bitops-bits-in-byte 250.52 ms 0.450 ms 45445.25 KB
New 232.01 ms (-7%) 0.338 ms 45447.46 KB (0%)
Old Run bitops-bitwise-and 183.40 ms 0.913 ms 93438.89 KB
New 144.90 ms (-21%) 0.297 ms 55938.59 KB (-40%)
Old Run bitops-nsieve-bits 209.32 ms 0.824 ms 54854.94 KB
New 209.42 ms (0%) 0.894 ms 54075.9 KB (-1%)
Old Run contr(...)rsive [21] 115.48 ms 0.253 ms 124116.86 KB
New 108.79 ms (-6%) 0.233 ms 108772.05 KB (-12%)
Old Run crypto-aes 138.69 ms 0.330 ms 15570.65 KB
New 140.10 ms (+1%) 0.259 ms 14945.07 KB (-4%)
Old Run crypto-md5 106.71 ms 0.305 ms 95412.42 KB
New 103.07 ms (-3%) 0.274 ms 88403.25 KB (-7%)
Old Run crypto-sha1 107.37 ms 0.292 ms 82071.72 KB
New 107.27 ms (0%) 1.078 ms 75069.09 KB (-9%)
Old Run date-format-tofte 101.71 ms 0.138 ms 46360.64 KB
New 101.47 ms (0%) 0.332 ms 45251.01 KB (-2%)
Old Run date-format-xparb 61.16 ms 0.134 ms 29412.61 KB
New 61.54 ms (+1%) 0.083 ms 28787.24 KB (-2%)
Old Run math-cordic 345.85 ms 1.011 ms 123970.21 KB
New 334.87 ms (-3%) 0.578 ms 113033.16 KB (-9%)
Old Run math-partial-sums 140.30 ms 0.329 ms 68948.38 KB
New 129.37 ms (-8%) 0.221 ms 50094.8 KB (-27%)
Old Run math-spectral-norm 135.45 ms 0.361 ms 67174.92 KB
New 130.40 ms (-4%) 0.370 ms 63333.36 KB (-6%)
Old Run regexp-dna 114.35 ms 0.605 ms 17672.22 KB
New 108.88 ms (-5%) 0.411 ms 17667.62 KB (0%)
Old Run string-base64 111.62 ms 0.331 ms 12525.78 KB
New 104.61 ms (-6%) 0.265 ms 11241.36 KB (-10%)
Old Run string-fasta 208.05 ms 0.334 ms 167274.79 KB
New 200.99 ms (-3%) 0.472 ms 155489.57 KB (-7%)
Old Run string-tagcloud 74.83 ms 0.519 ms 48438.33 KB
New 73.19 ms (-2%) 0.247 ms 48439.01 KB (0%)
Old Run string-unpack-code 78.00 ms 0.153 ms 84571.22 KB
New 76.52 ms (-2%) 0.101 ms 83958.43 KB (-1%)
Old Run strin(...)input [21] 85.57 ms 1.059 ms 44618.85 KB
New 83.10 ms (-3%) 0.307 ms 41619.18 KB (-7%)

Jint.Benchmark.StopwatchBenchmark

Diff Method Mean Error Allocated
Old Jint_ParsedScript 527.4 ms 1.74 ms 226.59 MB
New 400.7 ms (-24%) 1.11 ms 107.13 MB (-53%)

@lahma lahma changed the title Improve global object setup performance Improve global object setup and access performance Sep 3, 2022
@lahma lahma enabled auto-merge (squash) September 3, 2022 09:49
@lahma lahma merged commit 3a3e57c into sebastienros:main Sep 3, 2022
@lahma lahma deleted the reduce-nested-calls-for-global branch September 3, 2022 13:03
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

1 participant