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

LibJS: Weekend optimization pack #24296

Merged
merged 4 commits into from May 13, 2024

Conversation

awesomekling
Copy link
Member

Another batch of small optimizations.
Roughly 3% speed-up across all of Octane while Kraken looks neutral.

Suite       Test                                   Speedup  Old (Mean ± Range)           New (Mean ± Range)
----------  -----------------------------------  ---------  ---------------------------  --------------------------
Kraken      ai-astar.js                              1.011  2.710 ± 2.700 … 2.720        2.680 ± 2.660 … 2.700
Kraken      audio-beat-detection.js                  0.994  1.770 ± 1.760 … 1.780        1.780 ± 1.780 … 1.780
Kraken      audio-dft.js                             1.008  1.340 ± 1.340 … 1.340        1.330 ± 1.310 … 1.350
Kraken      audio-fft.js                             0.997  1.670 ± 1.670 … 1.670        1.675 ± 1.670 … 1.680
Kraken      audio-oscillator.js                      0.984  1.570 ± 1.570 … 1.570        1.595 ± 1.590 … 1.600
Kraken      imaging-darkroom.js                      1.005  2.180 ± 2.180 … 2.180        2.170 ± 2.070 … 2.270
Kraken      imaging-desaturate.js                    0.934  2.345 ± 2.340 … 2.350        2.510 ± 2.500 … 2.520
Kraken      imaging-gaussian-blur.js                 1.006  8.965 ± 8.960 … 8.970        8.910 ± 8.570 … 9.250
Kraken      json-parse-financial.js                  1.04   0.130 ± 0.130 … 0.130        0.125 ± 0.120 … 0.130
Kraken      json-stringify-tinderbox.js              0.98   0.240 ± 0.240 … 0.240        0.245 ± 0.240 … 0.250
Kraken      stanford-crypto-aes.js                   1.022  0.705 ± 0.700 … 0.710        0.690 ± 0.680 … 0.700
Kraken      stanford-crypto-ccm.js                   1.009  0.590 ± 0.590 … 0.590        0.585 ± 0.580 … 0.590
Kraken      stanford-crypto-pbkdf2.js                0.996  1.165 ± 1.160 … 1.170        1.170 ± 1.150 … 1.190
Kraken      stanford-crypto-sha256-iterative.js      1.054  0.485 ± 0.480 … 0.490        0.460 ± 0.450 … 0.470
Octane      box2d.js                                 1.012  2.460 ± 2.450 … 2.470        2.430 ± 2.420 … 2.440
Octane      code-load.js                             0.995  2.155 ± 2.150 … 2.160        2.165 ± 2.160 … 2.170
Octane      crypto.js                                1.002  7.250 ± 7.230 … 7.270        7.235 ± 7.130 … 7.340
Octane      deltablue.js                             1      2.035 ± 2.010 … 2.060        2.035 ± 2.030 … 2.040
Octane      earley-boyer.js                          0.999  17.470 ± 17.280 … 17.660     17.480 ± 17.390 … 17.570
Octane      gbemu.js                                 1.032  3.220 ± 3.210 … 3.230        3.120 ± 3.090 … 3.150
Octane      mandreel.js                              1.022  15.030 ± 14.570 … 15.490     14.700 ± 14.490 … 14.910
Octane      navier-stokes.js                         1.03   3.215 ± 3.210 … 3.220        3.120 ± 3.110 … 3.130
Octane      pdfjs.js                                 1.002  3.005 ± 3.000 … 3.010        3.000 ± 2.990 … 3.010
Octane      raytrace.js                              1.072  7.125 ± 7.060 … 7.190        6.645 ± 6.500 … 6.790
Octane      regexp.js                                0.997  22.210 ± 22.140 … 22.280     22.285 ± 22.150 … 22.420
Octane      richards.js                              1.005  2.020 ± 2.020 … 2.020        2.010 ± 2.010 … 2.010
Octane      splay.js                                 1.029  3.045 ± 3.040 … 3.050        2.960 ± 2.910 … 3.010
Octane      typescript.js                            0.984  37.695 ± 37.640 … 37.750     38.300 ± 38.180 … 38.420
Octane      zlib.js                                  1.066  106.620 ± 105.740 … 107.500  100.040 ± 99.850 … 100.230
Kraken      Total                                    0.998  25.865                       25.925
Octane      Total                                    1.031  234.555                      227.525
All Suites  Total                                    1.028  260.420                      253.450

And stop passing VM strictness to direct access, since it doesn't care
about strictness anyway.
This way we avoid looking up the identifier when the cache hits.
These were out-of-line because we had some ideas about marking
instruction streams PROT_READ only, but that seems pretty arbitrary and
there's a lot of performance to be gained by putting these inline.
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 12, 2024
@awesomekling awesomekling merged commit 855f641 into SerenityOS:master May 13, 2024
7 of 11 checks passed
@awesomekling awesomekling deleted the weekend_optimizations branch May 13, 2024 07:22
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 13, 2024
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