aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-timers-linked-list.js
diff options
context:
space:
mode:
authorAndras <andras@kinvey.com>2016-04-27 20:31:59 -0400
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2016-06-29 11:02:25 +0200
commit6f75b6672ca08c2bc3bf5fe14abb1a9648601e28 (patch)
treefc67efa679a469f0ddfd8c46a4f03ee0bb457c2b /test/parallel/test-timers-linked-list.js
parent6b0f86a8d519fd0780d2f6db2e7f28c2715dd795 (diff)
downloadandroid-node-v8-6f75b6672ca08c2bc3bf5fe14abb1a9648601e28.tar.gz
android-node-v8-6f75b6672ca08c2bc3bf5fe14abb1a9648601e28.tar.bz2
android-node-v8-6f75b6672ca08c2bc3bf5fe14abb1a9648601e28.zip
timers: optimize `setImmediate()`
Save the setImmediate() callback arguments into an array instead of a closure, and invoke the callback on the arguments from an optimizable function. 60% faster setImmediate with 0 args (15% if self-recursive) 4x faster setImmediate with 1-3 args, 2x with > 3 seems to be faster with less memory pressure when memory is tight Changes: - use L.create() to build faster lists - use runCallback() from within tryOnImmediate() - save the arguments and do not build closures for the callbacks PR-URL: https://github.com/nodejs/node/pull/6436 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-timers-linked-list.js')
-rw-r--r--test/parallel/test-timers-linked-list.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-timers-linked-list.js b/test/parallel/test-timers-linked-list.js
index cdae64d344..4ec7770cfa 100644
--- a/test/parallel/test-timers-linked-list.js
+++ b/test/parallel/test-timers-linked-list.js
@@ -103,8 +103,8 @@ assert.equal(C, L.shift(list));
// list
assert.ok(L.isEmpty(list));
-var list2 = L.create();
-var list3 = L.create();
+const list2 = L.create();
+const list3 = L.create();
assert.ok(L.isEmpty(list2));
assert.ok(L.isEmpty(list3));
assert.ok(list2 != list3);