Uh oh!
There was an error while loading. Please reload this page.
util: faster arrayToHash - #3964
Conversation
thefourtheye
commented
Nov 22, 2015
Why not a |
JacksonTian
commented
Nov 22, 2015
The result of |
bnoordhuis
commented
Nov 22, 2015
LGTM but can you add a small benchmark in |
cjihrig
commented
Nov 22, 2015
LGTM |
There was a problem hiding this comment.
I think that avoiding accessing the length property each time will speed up it a little more.
varl=array.length;varval;vari;for(i=0;i<l;i++){val=array[i];hash[val]=true;}There was a problem hiding this comment.
V8 can speedup it with OSR.
There was a problem hiding this comment.
using let here might have a more clear scope definition?
There was a problem hiding this comment.
v8 is smart enough these days to cache the length automatically, so this shouldn't be an issue.
The `util.format()` is used frequently, make the method faster is better.
JacksonTian
commented
Nov 22, 2015
Benchmark is here: varutil=require('util');varcommon=require('../common.js');varbench=common.createBenchmark(main,{n: [5e6]});functionmain(conf){varn=conf.n|0;bench.start();for(vari=0;i<n;i+=1){varr=util.inspect({a: 'a',b: 'b',c: 'c',d: 'd'});}bench.end(n);}before: after: cc @bnoordhuis |
8b519cc to
dc5bacbComparemscdex
commented
Nov 22, 2015
LGTM |
bnoordhuis
commented
Nov 22, 2015
Thanks, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/810/ |
bnoordhuis
commented
Nov 23, 2015
Linking to nodejs/build#263. |
evanlucas
commented
Dec 1, 2015
Trying CI again https://ci.nodejs.org/job/node-test-pull-request/887/ |
JacksonTian
commented
Dec 14, 2015
What's wrong with CI? |
cjihrig
commented
Dec 14, 2015
Running CI again, just because it's been 2 weeks: https://ci.nodejs.org/job/node-test-pull-request/991/ |
trevnorris
commented
Dec 28, 2015
Anything holding this up? |
cjihrig
commented
Dec 29, 2015
I don't think so. Running CI again, then hopefully this can land. https://ci.nodejs.org/job/node-test-pull-request/1106/ |
jasnell
commented
Dec 30, 2015
LGTM |
jasnell
commented
Dec 30, 2015
Will get this landed. |
The `util.format()` is used frequently, make the method faster is better. R-URL: #3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
jasnell
commented
Dec 30, 2015
Landed in 3e740ca |
jbergstroem
commented
Dec 31, 2015
Minor heads up, typo in commit message: |
jasnell
commented
Dec 31, 2015
Ugh. OK. Thanks for the heads up
|
The `util.format()` is used frequently, make the method faster is better. R-URL: nodejs#3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* http: - A new status code was added: 451 - "Unavailable For Legal Reasons" (Max Barinov) nodejs#4377 - Idle sockets that have been kept alive now handle errors (José F. Romaniello) nodejs#4482 * This release also includes several minor performance improvements: - assert: deepEqual is now speedier when comparing TypedArrays (Claudio Rodriguez) nodejs#4330 - lib: Use arrow functions instead of bind where possible (Minwoo Jung) nodejs#3622 - node: Improved accessor perf of process.env (Trevor Norris) nodejs#3780 - node: Improved performance of process.hrtime() (Trevor Norris) nodejs#3780, (Evan Lucas) nodejs#4484 - node: Improved GetActiveHandles performance (Trevor Norris) nodejs#3780 - util: Use faster iteration in util.format() (Jackson Tian) nodejs#3964 PR-URL: nodejs#4547
* http: - A new status code was added: 451 - "Unavailable For Legal Reasons" (Max Barinov) nodejs#4377 - Idle sockets that have been kept alive now handle errors (José F. Romaniello) nodejs#4482 * This release also includes several minor performance improvements: - assert: deepEqual is now speedier when comparing TypedArrays (Claudio Rodriguez) nodejs#4330 - lib: Use arrow functions instead of bind where possible (Minwoo Jung) nodejs#3622 - node: Improved accessor perf of process.env (Trevor Norris) nodejs#3780 - node: Improved performance of process.hrtime() (Trevor Norris) nodejs#3780, (Evan Lucas) nodejs#4484 - node: Improved GetActiveHandles performance (Trevor Norris) nodejs#3780 - util: Use faster iteration in util.format() (Jackson Tian) nodejs#3964 Refs: nodejs#4547 PR-URL: nodejs#4623 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The `util.format()` is used frequently, make the method faster is better. R-URL: #3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
The `util.format()` is used frequently, make the method faster is better. R-URL: #3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
The `util.format()` is used frequently, make the method faster is better. R-URL: nodejs#3964 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* http: - A new status code was added: 451 - "Unavailable For Legal Reasons" (Max Barinov) nodejs#4377 - Idle sockets that have been kept alive now handle errors (José F. Romaniello) nodejs#4482 * This release also includes several minor performance improvements: - assert: deepEqual is now speedier when comparing TypedArrays (Claudio Rodriguez) nodejs#4330 - lib: Use arrow functions instead of bind where possible (Minwoo Jung) nodejs#3622 - node: Improved accessor perf of process.env (Trevor Norris) nodejs#3780 - node: Improved performance of process.hrtime() (Trevor Norris) nodejs#3780, (Evan Lucas) nodejs#4484 - node: Improved GetActiveHandles performance (Trevor Norris) nodejs#3780 - util: Use faster iteration in util.format() (Jackson Tian) nodejs#3964 Refs: nodejs#4547 PR-URL: nodejs#4623 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The
util.format()is used frequently, make the method fasteris better.