GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: faster internal createBlob by H4ad · Pull Request #49730 · nodejs/node

Conversation

@H4ad

@H4ad H4ad commented Sep 20, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Inspired by nodejs/performance#109, I removed the usage of ReflectConstruct which is very heavy to call, and I also added a couple more benchmarks for blob.

Improvements:

                                           confidence improvement accuracy (*)     (**)    (***)
blob/creation.js kind='Blob' n=50000                       0.02 %       ±1.66%   ±2.21%   ±2.88%
blob/creation.js kind='createBlob' n=50000        ***   2727.18 %     ±138.63% ±186.82% ±248.02%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 2 comparisons, you can thus
expect the following amount of false-positive results:
  0.10 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.02 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)
                                 confidence improvement accuracy (*)    (**)   (***)
blob/resolveObjectURL.js n=50000        ***    304.19 %      ±11.73% ±15.80% ±20.95%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 1 comparisons, you can thus
expect the following amount of false-positive results:
  0.05 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.01 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)
                                    confidence improvement accuracy (*)    (**)   (***)
blob/slice.js dataSize=30720 n=50000        ***    445.71 %      ±32.71% ±44.06% ±58.44%
blob/slice.js dataSize=5 n=50000            ***    456.75 %      ±22.46% ±30.25% ±40.13%

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

I also think we can improve ClonedBlob but I tried using Function and also Class inheritance but I was not able to make it work correctly, but we probably can improve by 50% if we can make a version without ReflectConstruct.

cc @nodejs/performance

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Sep 20, 2023
@anonrig anonrig added performance Issues and PRs related to the performance of Node.js. needs-benchmark-ci PRs that need a benchmark CI run. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Sep 20, 2023
anonrig
anonrig approved these changes Sep 20, 2023
View reviewed changes
@anonrig anonrig added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 20, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 20, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54071/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

himself65
himself65 reviewed Sep 20, 2023
View reviewed changes
Comment thread lib/internal/blob.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

himself65
himself65 approved these changes Sep 20, 2023
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Sep 20, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54074/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

KhafraDev
KhafraDev requested changes Sep 20, 2023
View reviewed changes
Comment thread lib/internal/blob.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton

rluvaton commented Sep 20, 2023

Copy link
Copy Markdown
Member

I'm happy to see my PR inspired this 😀

H4ad and Qard reacted with heart emoji
All reactions
  • ❤️ 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@H4ad H4ad mentioned this pull request Sep 20, 2023
Perf of ReflectConstruct nodejs/performance#109
Closed
benjamingr
benjamingr approved these changes Sep 20, 2023
View reviewed changes
Ethan-Arrowood
Ethan-Arrowood approved these changes Sep 20, 2023
View reviewed changes
KhafraDev
KhafraDev approved these changes Sep 20, 2023
View reviewed changes
@github-actions github-actions Bot mentioned this pull request Sep 21, 2023
CI Reliability 2023-09-21 nodejs/reliability#672
Open
22 tasks
RafaelGSS
RafaelGSS approved these changes Sep 21, 2023
View reviewed changes

@RafaelGSS RafaelGSS left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@RafaelGSS RafaelGSS added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 21, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 21, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 21, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54138/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RafaelGSS

RafaelGSS commented Sep 21, 2023

Copy link
Copy Markdown
Member

Benchmark CI https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1402/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 22, 2023
CI Reliability 2023-09-22 nodejs/reliability#673
Open
17 tasks
@rluvaton

rluvaton commented Sep 22, 2023

Copy link
Copy Markdown
Member

It looks like the benchmark CI was stuck (nothing changed for 8 hours)

https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1406/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@H4ad

H4ad commented Sep 22, 2023

Copy link
Copy Markdown
Member Author

@rluvaton Can you cancel and start again? I lowered the values of the benchmark for blob and file, because of the regression found on nodejs/performance#118

rluvaton reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton

rluvaton commented Sep 22, 2023

Copy link
Copy Markdown
Member

Done https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1407/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@H4ad

H4ad commented Sep 22, 2023

Copy link
Copy Markdown
Member Author

This piece of code:

const buff = Buffer.allocUnsafe(1024 ** 2);
const source = new File(buff, 'dummy.txt', options);

const now = performance.now();
source.text().then(() => console.log(`diff: ${performance.now() - now}`));

Takes 3s to run, and running 1e3 will take a looong time, I will update the benchmark again, sorry for that.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 23, 2023
CI Reliability 2023-09-23 nodejs/reliability#674
Open
16 tasks
@aduh95 aduh95 removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 29, 2023
anonrig
anonrig approved these changes Oct 4, 2023
View reviewed changes
@anonrig anonrig added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 4, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 4, 2023
@nodejs-github-bot

nodejs-github-bot commented Oct 4, 2023

Copy link
Copy Markdown
Collaborator

Landed in 328bdac...1a839f3

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot closed this Oct 4, 2023
nodejs-github-bot pushed a commit that referenced this pull request Oct 4, 2023
@H4ad @nodejs-github-bot
benchmark: added new benchmarks for blob
86fe5a8
PR-URL: #49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Oct 4, 2023
@H4ad @nodejs-github-bot
lib: faster internal createBlob
589ac50
PR-URL: #49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
nodejs-github-bot pushed a commit that referenced this pull request Oct 4, 2023
@H4ad @nodejs-github-bot
benchmark: improved config for blob,file benchmark
1a839f3
PR-URL: #49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@H4ad
H4ad deleted the perf/faster-blob branch October 4, 2023 01:13
@H4ad H4ad mentioned this pull request Oct 5, 2023
Invalid Commit Message nodejs/core-validate-commit#117
Open
@github-actions github-actions Bot mentioned this pull request Oct 5, 2023
CI Reliability 2023-10-05 nodejs/reliability#684
Open
13 tasks
@tniessen

tniessen commented Oct 5, 2023

Copy link
Copy Markdown
Member

@anonrig FWIW, none of the three commits that were merged here adhere to our commit message guidelines.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig

anonrig commented Oct 5, 2023

Copy link
Copy Markdown
Member

@anonrig FWIW, none of the three commits that were merged here adhere to our commit message guidelines.

Is this a bug with node-core-utils? It seems we shouldn't even land commit that adhere.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented Oct 5, 2023

Copy link
Copy Markdown
Contributor

Reviewing the commit message is the burden of the PR author and the reviewers, NCU can only catch a subset of commit message "violation" – in this case, it would be very hard for NCU to guess that added, faster, and improved are not imperative verbs.

tniessen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Uzlopak

Uzlopak commented Oct 5, 2023

Copy link
Copy Markdown
Contributor

The problem is that the length of the first commit message was reported to be too long. So something should have errored like when you dont prefix the First commit message with util: or so.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RafaelGSS RafaelGSS mentioned this pull request Oct 9, 2023
2023-10-17, Version 21.0.0 (Current) #49870
Merged
@tniessen tniessen mentioned this pull request Oct 11, 2023
lib: reduce overhead of blob clone #50110
Merged
targos pushed a commit that referenced this pull request Nov 11, 2023
@H4ad @targos
benchmark: added new benchmarks for blob
b707574
PR-URL: #49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@targos targos added dont-land-on-v18.x labels Nov 11, 2023
targos pushed a commit that referenced this pull request Nov 11, 2023
@H4ad @targos
benchmark: improved config for blob,file benchmark
88611d1
PR-URL: #49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@targos targos mentioned this pull request Nov 12, 2023
v20.10.0 release proposal #50682
Merged
@juanarbol juanarbol mentioned this pull request Dec 6, 2023
2023-12-06, N|Solid v5.0.1 Iron Release nodesource/nsolid#41
Merged
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
@H4ad @debadree25
benchmark: added new benchmarks for blob
bc25ec1
PR-URL: nodejs#49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
@H4ad @debadree25
lib: faster internal createBlob
f7ca69c
PR-URL: nodejs#49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
@H4ad @debadree25
benchmark: improved config for blob,file benchmark
1f30134
PR-URL: nodejs#49730
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
@github-actions github-actions Bot mentioned this pull request Apr 24, 2024
Adding VersionStream for nodejs-22 wolfi-dev/os#17646
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@himself65 himself65 himself65 approved these changes
@Qard Qard Qard approved these changes
@benjamingr benjamingr benjamingr approved these changes
@anonrig anonrig anonrig approved these changes
@Ethan-Arrowood Ethan-Arrowood Ethan-Arrowood approved these changes
@RafaelGSS RafaelGSS RafaelGSS approved these changes
@KhafraDev KhafraDev KhafraDev approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. needs-benchmark-ci PRs that need a benchmark CI run. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

14 participants

@H4ad @nodejs-github-bot @rluvaton @RafaelGSS @aduh95 @Uzlopak @tniessen @anonrig @Qard @benjamingr @himself65 @Ethan-Arrowood @KhafraDev @targos
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.