summaryrefslogtreecommitdiff
path: root/common.gypi
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2018-05-14 12:17:38 -0700
committerAli Ijaz Sheikh <ofrobots@google.com>2018-05-17 11:23:36 -0700
commit0ebbd764a8700f6900d4b4b88e43307b335d64a5 (patch)
tree6cbf673c8cb6f96bd9dab61b1702268d389efd82 /common.gypi
parent2773de52fd7fac2f6b690e9dd9411cb3a0cd365e (diff)
downloadandroid-node-v8-0ebbd764a8700f6900d4b4b88e43307b335d64a5.tar.gz
android-node-v8-0ebbd764a8700f6900d4b4b88e43307b335d64a5.tar.bz2
android-node-v8-0ebbd764a8700f6900d4b4b88e43307b335d64a5.zip
deps: V8: cherry-pick b49206d from upstream
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 <yangguo@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#52753} PR-URL: https://github.com/nodejs/node/pull/20727 Ref: https://github.com/nodejs/node/issues/20083 Refs: https://github.com/nodejs/node/issues/20083 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'common.gypi')
-rw-r--r--common.gypi2
1 files changed, 1 insertions, 1 deletions
diff --git a/common.gypi b/common.gypi
index adeaf85c12..d7a730906b 100644
--- a/common.gypi
+++ b/common.gypi
@@ -27,7 +27,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
- 'v8_embedder_string': '-node.7',
+ 'v8_embedder_string': '-node.8',
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,