Skip to content

Conversation

@ofrobots
Copy link
Contributor

8.x backport of #20727

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

@MylesBorins @nodejs/v8-update

@nodejs-github-botnodejs-github-bot added v8 engine Issues and PRs related to the V8 dependency. v8.x labels Jun 25, 2018
@ofrobots
Copy link
ContributorAuthor

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

I haven't launched a V8-CI yet as that is blocked by #21433

@veered
Copy link

@ofrobots Any idea when this will make it to general release?

@ofrobots
Copy link
ContributorAuthor

This is currently blocked on #21534.

@ofrobotsofrobots added the blocked PRs that are blocked by other issues or PRs. label Jun 28, 2018
@mmarchini
Copy link
Contributor

V8 CI: https://ci.nodejs.org/view/All/job/node-test-commit-v8-linux/1494/

x86 is passing

@ofrobotsofrobots removed the blocked PRs that are blocked by other issues or PRs. label Jun 28, 2018
@ofrobots
Copy link
ContributorAuthor

V8-CI is green. I will go ahead and land this on v8.x-staging shortly.

This is the v8.x backport of nodejs#20727. Original commit message: ThreadDataTable: Change global linked list to per-Isolate hash map. For use cases with a large number of threads or a large number of isolates (or both), ThreadDataTable can be a major performance bottleneck due to O(n) lookup time of the linked list. Switching to a hash map reduces this to O(1). Example 1: Sandstorm.io, a Node.js app that utilizes "fibers", was observed spending the majority of CPU time iterating over the ThreadDataTable. See: https://sandstorm.io/news/2016-09-30-fiber-bomb-debugging-story Example 2: Cloudflare's Workers engine, a high-multi-tenancy web server framework built on V8 (but not Node), creates large numbers of threads and isolates per-process. It saw a 34x improvement in throughput when we applied this patch. Cloudflare has been using a patch in production since the Worker launch which replaces the linked list with a hash map -- but still global. This commit builds on that but goes further and creates a separate hash map and mutex for each isolate, with the table being a member of the Isolate class. This avoids any globals and should reduce lock contention. Bug: v8:5338 Change-Id: If0d11509afb2e043b888c376e36d3463db931b47 Reviewed-on: https://chromium-review.googlesource.com/1014407 Reviewed-by: Yang Guo <[email protected]> Commit-Queue: Yang Guo <[email protected]> Cr-Commit-Position: refs/heads/master@{nodejs#52753} Backport-PR-URL: nodejs#21529 PR-URL: nodejs#20727 Refs: nodejs#20083 Refs: nodejs#20083 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
@ofrobotsofrobots merged commit 646445b into nodejs:v8.x-stagingJun 28, 2018
@ofrobots
Copy link
ContributorAuthor

Landed on v8.x-staging as 646445b.

@ofrobotsofrobots deleted the backport/8/20727 branch June 28, 2018 20:19
@veered
Copy link

Thanks for getting this over the line @ofrobots!!! This will be a massive benefit to the Meteor community

@veered
Copy link

How long until this change is properly released?

@KoenLav
Copy link

@veered#21593

rvagg pushed a commit that referenced this pull request Aug 16, 2018
This is the v8.x backport of #20727. Original commit message: ThreadDataTable: Change global linked list to per-Isolate hash map. For use cases with a large number of threads or a large number of isolates (or both), ThreadDataTable can be a major performance bottleneck due to O(n) lookup time of the linked list. Switching to a hash map reduces this to O(1). Example 1: Sandstorm.io, a Node.js app that utilizes "fibers", was observed spending the majority of CPU time iterating over the ThreadDataTable. See: https://sandstorm.io/news/2016-09-30-fiber-bomb-debugging-story Example 2: Cloudflare's Workers engine, a high-multi-tenancy web server framework built on V8 (but not Node), creates large numbers of threads and isolates per-process. It saw a 34x improvement in throughput when we applied this patch. Cloudflare has been using a patch in production since the Worker launch which replaces the linked list with a hash map -- but still global. This commit builds on that but goes further and creates a separate hash map and mutex for each isolate, with the table being a member of the Isolate class. This avoids any globals and should reduce lock contention. Bug: v8:5338 Change-Id: If0d11509afb2e043b888c376e36d3463db931b47 Reviewed-on: https://chromium-review.googlesource.com/1014407 Reviewed-by: Yang Guo <[email protected]> Commit-Queue: Yang Guo <[email protected]> Cr-Commit-Position: refs/heads/master@{#52753} Backport-PR-URL: #21529 PR-URL: #20727 Refs: #20083 Refs: #20083 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v8 engineIssues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ofrobots@nodejs-github-bot@veered@mmarchini@KoenLav