Files
node/lib
Ben Noordhuis bbf54a554a lib: hand-optimize Buffer constructor
The Buffer constructor is used pervasively throughout io.js, yet it was
one of the most unwieldy functions in core.  This commit breaks up the
constructor into several small functions in a way that makes V8 happy.

About 8-10% CPU time was attributed to the constructor function before
in buffer-heavy benchmarks.  That pretty much drops to zero now because
V8 can now easily inline it at the call site.  It shortens the running
time of the following simple benchmark by about 15%:

    for (var i = 0; i < 25e6; ++i) new Buffer(1);

And about 8% from this benchmark:

    for (var i = 0; i < 1e7; ++i) new Buffer('x', 'ucs2');

PR-URL: https://github.com/iojs/io.js/pull/1048
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-03-05 19:44:50 +01:00
..
2015-01-31 23:47:29 -05:00
2015-01-31 23:47:29 -05:00
2015-01-31 23:47:29 -05:00
2015-03-03 17:05:55 -05:00
2015-02-09 14:14:20 +03:00
2015-01-31 23:47:29 -05:00
2015-01-31 23:47:29 -05:00
2015-01-21 16:21:31 -05:00
2015-02-07 12:00:16 -08:00
2015-02-13 13:37:25 -05:00
2015-03-05 10:01:15 -05:00
2015-01-21 16:21:31 -05:00
2015-01-31 23:47:29 -05:00
2014-11-28 13:21:43 +03:00
2015-01-31 23:47:29 -05:00
2015-02-22 20:07:25 -08:00
2015-01-31 23:47:29 -05:00
2015-03-04 11:37:12 +03:00
2015-01-31 23:47:29 -05:00
2015-01-21 16:21:31 -05:00
2015-02-16 12:33:12 +01:00
2015-01-31 23:47:29 -05:00
2015-01-21 16:21:31 -05:00
2015-01-31 23:47:29 -05:00
2015-01-31 23:47:29 -05:00