src,tools: speed up startup by 2.5%
Use zero-copy external string resources for storing the built-in JS source code. Saves a few hundred kilobyte of memory and consistently speeds up `benchmark/misc/startup.js` by 2.5%. Everything old is new again! Commit 74954ce7 ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a361 ("src: don't use NewExternal() with unaligned strings") because of a limitation in the V8 API. V8 no longer requires that strings are aligned if they are one-byte strings so it should be safe to re-enable external strings again. PR-URL: https://github.com/nodejs/node/pull/5458 Reviewed-By:James M Snell <jasnell@gmail.com> Reviewed-By:
Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
parent
2a456162
Please register or sign in to comment