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

zlib: refactor to use more primordials #36347

Merged
merged 1 commit into from Dec 4, 2020
Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Dec 1, 2020

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the zlib Issues and PRs related to the zlib subsystem. label Dec 1, 2020
@aduh95
Copy link
Contributor Author

aduh95 commented Dec 2, 2020

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/745/console (queued, will 404 until it starts)

@benjamingr
Copy link
Member

I have no idea how with all those extra arrays call vs. apply and the extra step - brotili is 10% faster

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 2, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 2, 2020
@nodejs-github-bot

This comment has been minimized.

@aduh95
Copy link
Contributor Author

aduh95 commented Dec 2, 2020

Benchmark results:

                                                                       confidence improvement accuracy (*)    (**)   (***)
zlib/creation.js n=500000 options='false' type='BrotliCompress'                **      5.76 %       ±3.82%  ±5.09%  ±6.62%
zlib/creation.js n=500000 options='false' type='BrotliDecompress'             ***      9.91 %       ±5.29%  ±7.06%  ±9.23%
zlib/creation.js n=500000 options='false' type='InflateRaw'                    **      5.32 %       ±3.34%  ±4.45%  ±5.81%
zlib/creation.js n=500000 options='true' type='BrotliCompress'                  *      5.75 %       ±4.66%  ±6.20%  ±8.07%
zlib/creation.js n=500000 options='true' type='BrotliDecompress'              ***      8.71 %       ±4.39%  ±5.85%  ±7.62%
zlib/creation.js n=500000 options='true' type='InflateRaw'                      *      3.95 %       ±3.60%  ±4.80%  ±6.25%
                                                                       confidence improvement accuracy (*)    (**)   (***)
zlib/createInflate.js n=100 chunkLen=1024 inputLen=16777216                            4.53 %       ±5.83%  ±7.75% ±10.10%
zlib/creation.js n=500000 options='false' type='BrotliCompress'                **      5.76 %       ±3.82%  ±5.09%  ±6.62%
zlib/creation.js n=500000 options='false' type='BrotliDecompress'             ***      9.91 %       ±5.29%  ±7.06%  ±9.23%
zlib/creation.js n=500000 options='false' type='Deflate'                              -1.14 %       ±3.16%  ±4.21%  ±5.49%
zlib/creation.js n=500000 options='false' type='DeflateRaw'                            2.50 %       ±4.08%  ±5.42%  ±7.06%
zlib/creation.js n=500000 options='false' type='Gunzip'                                1.94 %       ±3.99%  ±5.32%  ±6.93%
zlib/creation.js n=500000 options='false' type='Gzip'                                  1.27 %       ±3.61%  ±4.80%  ±6.26%
zlib/creation.js n=500000 options='false' type='Inflate'                               2.72 %       ±3.32%  ±4.42%  ±5.75%
zlib/creation.js n=500000 options='false' type='InflateRaw'                    **      5.32 %       ±3.34%  ±4.45%  ±5.81%
zlib/creation.js n=500000 options='false' type='Unzip'                                 3.37 %       ±4.67%  ±6.23%  ±8.14%
zlib/creation.js n=500000 options='true' type='BrotliCompress'                  *      5.75 %       ±4.66%  ±6.20%  ±8.07%
zlib/creation.js n=500000 options='true' type='BrotliDecompress'              ***      8.71 %       ±4.39%  ±5.85%  ±7.62%
zlib/creation.js n=500000 options='true' type='Deflate'                               -0.91 %       ±3.18%  ±4.24%  ±5.51%
zlib/creation.js n=500000 options='true' type='DeflateRaw'                            -0.44 %       ±4.47%  ±5.95%  ±7.76%
zlib/creation.js n=500000 options='true' type='Gunzip'                                 1.68 %       ±4.16%  ±5.54%  ±7.21%
zlib/creation.js n=500000 options='true' type='Gzip'                                  -2.62 %       ±4.54%  ±6.05%  ±7.89%
zlib/creation.js n=500000 options='true' type='Inflate'                                2.80 %       ±4.67%  ±6.21%  ±8.08%
zlib/creation.js n=500000 options='true' type='InflateRaw'                      *      3.95 %       ±3.60%  ±4.80%  ±6.25%
zlib/creation.js n=500000 options='true' type='Unzip'                                  1.36 %       ±4.76%  ±6.34%  ±8.25%
zlib/deflate.js n=400000 inputLen=1024 method='createDeflate'                         -0.79 %      ±11.18% ±14.88% ±19.38%
zlib/deflate.js n=400000 inputLen=1024 method='deflate'                                0.83 %       ±5.10%  ±6.78%  ±8.82%
zlib/deflate.js n=400000 inputLen=1024 method='deflateSync'                            3.35 %      ±10.48% ±13.94% ±18.15%
zlib/inflate.js n=400000 inputLen=1024 method='inflate'                               -2.39 %       ±3.16%  ±4.21%  ±5.48%
zlib/inflate.js n=400000 inputLen=1024 method='inflateSync'                           -0.32 %       ±4.20%  ±5.59%  ±7.27%
zlib/pipe.js algorithm='brotli' type='buffer' duration=5 inputLen=1024                -0.38 %       ±2.83%  ±3.77%  ±4.92%
zlib/pipe.js algorithm='brotli' type='string' duration=5 inputLen=1024                -0.33 %       ±1.14%  ±1.52%  ±1.98%
zlib/pipe.js algorithm='gzip' type='buffer' duration=5 inputLen=1024                  -0.98 %       ±5.79%  ±7.70% ±10.04%
zlib/pipe.js algorithm='gzip' type='string' duration=5 inputLen=1024                  -1.84 %       ±3.67%  ±4.89%  ±6.37%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case there are 28 comparisons, you can thus
expect the following amount of false-positive results:
 1.40 false positives, when considering a   5% risk acceptance (*, **, ***),
 0.28 false positives, when considering a   1% risk acceptance (**, ***),
 0.03 false positives, when considering a 0.1% risk acceptance (***)

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

PR-URL: nodejs#36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott Trott merged commit e4d570f into nodejs:master Dec 4, 2020
@Trott
Copy link
Member

Trott commented Dec 4, 2020

Landed in e4d570f

@aduh95 aduh95 deleted the zlib-primordials branch December 4, 2020 14:36
danielleadams pushed a commit that referenced this pull request Dec 7, 2020
PR-URL: #36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request Dec 7, 2020
cjihrig pushed a commit to cjihrig/node that referenced this pull request Dec 8, 2020
PR-URL: nodejs#36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request May 16, 2021
PR-URL: #36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
PR-URL: #36347
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. zlib Issues and PRs related to the zlib subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants