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 — src: skip costly pushing/popping if we pass zeroes as async context by ronag · Pull Request #41279 · nodejs/node

Conversation

@ronag

@ronag ronag commented Dec 22, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Improve MakeCallback performance:

From uws:

This patch reliably boosts performance by 12% of req/sec on Linux:

Sorry, something went wrong.

Uh oh!

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

bricss, skuzmin, uasan, mtsewrs, vlasky, and okenwaonyebuchi reacted with thumbs up emoji
All reactions
  • 👍 6 reactions
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Dec 22, 2021
@ronag ronag added the async_hooks Issues and PRs related to the async hooks subsystem. label Dec 22, 2021
@uNetworkingAB @ronag
src: skip costly pushing/popping if we pass zeroes as async context
16544c4
@ronag
ronag force-pushed the skip-async-context branch from adaa3f4 to 16544c4 Compare December 22, 2021 08:45
@ronag
fixup
89afce7
@ronag
ronag requested a review from addaleax December 22, 2021 14:12
@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. and removed needs-ci PRs that need a full CI run. labels Dec 22, 2021
@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 Dec 22, 2021
@nodejs-github-bot

nodejs-github-bot commented Dec 22, 2021

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

addaleax
addaleax requested changes Dec 22, 2021
View reviewed changes

@addaleax addaleax 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.

This only increases performance for deprecated legacy usage of the MakeCallback API (namely the one in which addons do not implement proper async tracking) – that seems like a bad idea, tbh.

Sorry, something went wrong.

Uh oh!

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

All reactions
@ronag

ronag commented Dec 22, 2021

Copy link
Copy Markdown
Member Author

What’s the harm though? I don’t have any use for the async context in my use case and the performance boost is kind of nice.

vlasky and porsager reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax

addaleax commented Dec 22, 2021

Copy link
Copy Markdown
Member

@ronag I mean ... it's more of a general principle that deprecated features a) should not add complexity to the code when avoidable and b) should not look like supported or encouraged use cases.

I don’t have any use for the async context in my use case

That might be true, but it seems like that's specific to your use case? Authors of addons cannot know whether their consumers use async tracking functionality or not (unless they are the same people, i.e. private addons, I guess), and Node.js has made it fairly clear that async tracking is a feature that the platform provides and that addons should support.

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 Dec 23, 2021
CI Reliability 2021-12-23 nodejs/reliability#153
Open
19 tasks
@uasan

uasan commented Dec 23, 2021

Copy link
Copy Markdown

@addaleax, You listed the political arguments.
That mean that everyone has to pay a price for what they don't use, this is a weird policy (

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott

Trott commented Dec 23, 2021

Copy link
Copy Markdown
Member

@addaleax, You listed the political arguments.

She made the argument from the point of view of maintainability.

That mean that everyone has to pay a price for what they don't use, this is a weird policy (

Maybe I'm misunderstanding something but I took her argument to be the opposite: No cost should be incurred by the project maintainers to improve performance of deprecated features. That seems like a reasonable position for someone to take.

All reactions

Sorry, something went wrong.

Uh oh!

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

@uasan

uasan commented Dec 23, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Maybe I'm misunderstanding something but I took her argument to be the opposite: No cost should be incurred by the project maintainers to improve performance of deprecated features. That seems like a reasonable position for someone to take.

No, here's the cost everyone pays, without this patch
img

vlasky reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

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

This was referenced Dec 24, 2021
CI Reliability 2021-12-24 nodejs/reliability#154
Open
CI Reliability 2021-12-25 nodejs/reliability#155
Open
CI Reliability 2021-12-26 nodejs/reliability#156
Open
@addaleax

addaleax commented Dec 26, 2021

Copy link
Copy Markdown
Member

No, here's the cost everyone pays, without this patch

That graph is comparing Node.js versions, and doesn't show what was actually being benchmarked. Unfortunately, that is not meaningful as data here.

And to say "everyone pays, without this patch" is misleadingly worded -- if there is a performance penalty without this patch (and I would assume there is because I assume that @ronag has benchmarked this), it is payed by people who use addons that use Node.js functionality in a deprecated way, not by everyone.

(And to be clear, this is not general opposition to performance improvements regarding MakeCallback.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@e3dio

e3dio commented Dec 26, 2021

Copy link
Copy Markdown

Unfortunately, that is not meaningful as data

@trevnorris did detailed benchmark of MakeCallback, does this count? https://gist.github.com/trevnorris/35c8e570c3097f58739b84bfa3f0a390

Which happens to match up exactly with Addon benchmark request per second / echos per second

image

Hopefully the trend has not continued downward, I have not done recent benchmark

All reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax

addaleax commented Dec 26, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

does this count

@e3dio To be clear: What’s missing isn’t valid benchmarking data, it’s relevant benchmarking data. Of course it “counts” as valid benchmarking results; but it’s only data that can be taken to say “there is a performance issue”. It’s not data that can be taken to say “this PR meaningfully addresses that issue”.

All reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax addaleax mentioned this pull request Dec 26, 2021
src: improve MakeCallback() performance #41331
Closed
@addaleax

addaleax commented Dec 26, 2021

Copy link
Copy Markdown
Member

Opened #41331, which also removes the overhead of pushing/popping async context, and does so in a way that actually benefits all users of MakeCallback().

uasan and ronag reacted with thumbs up emoji
All reactions
  • 👍 2 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 Dec 27, 2021
CI Reliability 2021-12-27 nodejs/reliability#157
Open
17 tasks
@ronag ronag closed this Dec 27, 2021
This was referenced Dec 28, 2021
CI Reliability 2021-12-28 nodejs/reliability#158
Open
CI Reliability 2021-12-29 nodejs/reliability#159
Open
This was referenced Dec 30, 2021
CI Reliability 2021-12-30 nodejs/reliability#160
Open
CI Reliability 2021-12-31 nodejs/reliability#161
Open
@abenhamdine abenhamdine mentioned this pull request Dec 1, 2022
MakeCallback is very slow nodejs/performance#24
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax requested changes

Uh oh!

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

Assignees

No one assigned

Labels

async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++.

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.

7 participants

@ronag @nodejs-github-bot @addaleax @uasan @Trott @e3dio @uNetworkingAB
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.