FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: use new.target instead of instaceof to detect construct calls by joyeecheung · Pull Request #51026 · nodejs/node · GitHub

/ node Public

crypto: use new.target instead of instaceof to detect construct calls - #51026

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
joyeecheung:hash-new-target
Dec 5, 2023
Merged

crypto: use new.target instead of instaceof to detect construct calls#51026
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
joyeecheung:hash-new-target

Conversation

joyeecheung commented Dec 3, 2023
edited
Loading

Copy link
Copy Markdown
Member

The former is much more performant.

Refs: nodejs/performance#136

On macOS + M2:

                                                                                confidence improvement accuracy (*)   (**)  (***)
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=10 sync='createHash'           ***      4.19 %       ±1.05% ±1.40% ±1.84%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=100 sync='createHash'          ***      4.83 %       ±0.64% ±0.85% ±1.10%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=20 sync='createHash'            **      3.77 %       ±2.59% ±3.49% ±4.62%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=50 sync='createHash'           ***      5.10 %       ±0.56% ±0.75% ±0.98%
crypto/webcrypto-digest.js n=100000 method='SHA-256' data=10 sync='createHash'         ***      5.82 %       ±2.27% ±3.05% ±4.04%
crypto/webcrypto-digest.js n=100000 method='SHA-256' data=100 sync='createHash'        ***      5.86 %       ±2.46% ±3.31% ±4.37%
crypto/webcrypto-digest.js n=100000 method='SHA-256' data=20 sync='createHash'         ***      5.92 %       ±2.24% ±3.02% ±4.00%
crypto/webcrypto-digest.js n=100000 method='SHA-256' data=50 sync='createHash'         ***      5.67 %       ±0.50% ±0.66% ±0.87%
crypto/webcrypto-digest.js n=100000 method='SHA-384' data=10 sync='createHash'         ***      4.68 %       ±0.72% ±0.96% ±1.25%
crypto/webcrypto-digest.js n=100000 method='SHA-384' data=100 sync='createHash'        ***      5.83 %       ±2.52% ±3.39% ±4.49%
crypto/webcrypto-digest.js n=100000 method='SHA-384' data=20 sync='createHash'           *      2.91 %       ±2.73% ±3.68% ±4.88%
crypto/webcrypto-digest.js n=100000 method='SHA-384' data=50 sync='createHash'         ***      4.19 %       ±0.79% ±1.06% ±1.39%
crypto/webcrypto-digest.js n=100000 method='SHA-512' data=10 sync='createHash'          **      3.51 %       ±2.28% ±3.07% ±4.06%
crypto/webcrypto-digest.js n=100000 method='SHA-512' data=100 sync='createHash'        ***      5.01 %       ±0.54% ±0.71% ±0.93%
crypto/webcrypto-digest.js n=100000 method='SHA-512' data=20 sync='createHash'          **      4.38 %       ±2.64% ±3.53% ±4.64%
crypto/webcrypto-digest.js n=100000 method='SHA-512' data=50 sync='createHash'          **      4.01 %       ±2.40% ±3.22% ±4.26%
crypto/create-hash.js n=100000        ***      6.77 %       ±3.00% ±3.99% ±5.20%

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto

nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Dec 3, 2023

Copy link
Copy Markdown
Member Author

targos commented Dec 3, 2023

Copy link
Copy Markdown
Member

There's a typo in the commit message (instaceof)

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

Comment thread benchmark/crypto/create-hash.js Outdated

tniessen commented Dec 3, 2023

Copy link
Copy Markdown
Member

As usual, amazing work @joyeecheung :)

…t calls

Co-authored-by: Vinicius Lourenço <12551007+H4ad@users.noreply.github.com>
joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 3, 2023
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 3, 2023

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

joyeecheung added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Dec 5, 2023
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 5, 2023
nodejs-github-bot merged commit c97322a into nodejs:main Dec 5, 2023

Copy link
Copy Markdown
Collaborator

Landed in c97322a

RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
PR-URL: #51026
Refs: nodejs/performance#136
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
RafaelGSS mentioned this pull request Dec 15, 2023
richardlau pushed a commit that referenced this pull request Mar 25, 2024
PR-URL: #51026
Refs: nodejs/performance#136
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
richardlau mentioned this pull request Mar 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL