-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src,tools: speed up startup by 2.5% #5458
Conversation
I didn't test but I expect that the speed-up on slower systems will be even more significant. |
/* Default calls `delete this`. */ \ | ||
} \ | ||
} id##_external_data; | ||
NODE_NATIVES_MAP(V) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this under-indented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really seem to have a convention for indentation in macros but two spaces appears to be most common:
$ perl -ne 'if (/define V\(/ && /\\$/) { <> =~ /^(\s+)/; print "| ", length($1), " spaces\n" }' src/*.{cc,h} | sort | uniq -c | sort -nr
16 | 2 spaces
7 | 4 spaces
1 | 6 spaces
1 | 30 spaces
LGTM |
Marking as don't land on v4 for now... can potentially revisit that if the v8 limitation is lifted there also |
Crikey, looks like VS 2013 expands the macro wrong... 2015 gets it right but that's not much comfort. |
O.o ... that's fun. VS 2013 is always full of wonderful surprises. |
79f85ba
to
90aa74b
Compare
CI with workaround: https://ci.nodejs.org/job/node-test-pull-request/1860/ |
And another workaround... https://ci.nodejs.org/job/node-test-pull-request/1862/ |
One more VS fix-up... https://ci.nodejs.org/job/node-test-pull-request/1865/ |
Make that https://ci.nodejs.org/job/node-test-pull-request/1867/, Jenkins crapped out. |
And again because the Windows status page kept timing out... https://ci.nodejs.org/job/node-test-pull-request/1870/ |
Appears to be a significant bit of breakage on one of the windows machines. |
@bnoordhuis ... ping |
7da4fd4
to
c7066fb
Compare
563fad5
to
364e887
Compare
Updated, PTAL. CI: https://ci.nodejs.org/job/node-test-pull-request/2641/ |
364e887
to
85481f7
Compare
Rebased: https://ci.nodejs.org/job/node-test-pull-request/3120/ Can I get a LGTM? |
LGTM |
For the record: "Everything old is new again!" Is my absolute favourite commit of all time. Is there a place where making VS2015 requirement for compilation was discussed? Probably not so easy, right? But definitely much more comfortable. |
@bnoordhuis It looks like win2008r2 VS2013 totally failed? |
c133999
to
83c7a88
Compare
69c38fe
to
abaa566
Compare
Dusted off and rebased. CI: https://ci.nodejs.org/job/node-test-pull-request/4654/ |
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: nodejs#5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
abaa566
to
e4290de
Compare
Can this land on v7? |
Yes, it's semver-patch. |
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: #5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
* Those from v7 are causing memory insufficiency when compiling * cf. nodejs/node#5458
I've gone ahead and backported this to v6.x. I believe it has spent enough time maturing on v7.x Please feel free to let me know if you think it needs to spend more time before backport |
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: #5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: #5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: #5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
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 74954ce ("Add string class that uses ExternalAsciiStringResource.") from 2011 did the same thing but I removed that in 2013 in commit 34b0a36 ("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: nodejs/node#5458 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
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 74954ce ("Add string class that
uses ExternalAsciiStringResource.") from 2011 did the same thing but
I removed that in 2013 in commit 34b0a36 ("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.
CI: https://ci.nodejs.org/job/node-test-pull-request/1763/