-
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
Backport of V8 CpuProfiler fixes/improvements #26816
Comments
Thanks for following up, here's what I'd suggest (in chronological order): [cpu-profiler] Add source positions for inlined function calls [cpu-profiler] Reduce the size of inlining information [cpu-profiler] Reduce size of circular queue to 512 KiB [cpu-profiler] De-duplicate CodeEntry objects for inline stacks [cpu-profiler] Use compare_exchange_strong in DoSample [cpu-profiler] Fix flaky crashes on Windows caused by stack reads The first four are for reducing memory usage, the last 2 are bug fixes (probably not a huge deal for Node because they only show up on ARM and windows respectively). I think all of them should apply to 8 & 10 cleanly - there wasn't much change between 8 & 10 in the profiler, and everything that I've backported to 10 I've also backported to 8. |
Thanks! I will take a look on my next free slot. |
Great, thanks for working on this. Here is the fix for the shutdown delay, might want that as well: [cpu-profiler] Wait on a condition variable in the sampling thread to enable quicker shutdowns |
I tried to backport them but even the first patch doesn't apply clean on v11 nor v10. I tried to fix the conflicts but it seems it's not working correct for Node 10 as memory consumption increases. I used the crazy sample from #23070 (comment) and for NodeJs 10 the VM Heap after the usecase is ~40MB instead 11MB without the patches (tested on windows). NodeJS 11 shows the higher mem consumption in general in this case, independent of the patches. The peak memory consumption went down so this looks ok. See my fork of node regarding the current state: Not sure if it makes sense that I continue here as my experience of V8 inner workings is really limited. |
I will have a go at the backporting, maybe there are some other intermediate patches we need too. |
I backported all those changes to 10 and resolved the conflicts, could you use my branch to check the memory situation? https://github.com/psmarshall/node/tree/v10-profiler-memory. I made the patch against v10.x-staging. I'll also try to measure using the sample server I used before. |
Hmm I can't reproduce the memory savings with that patch. I can't think of what is different to the first time I took the measurements though. I'll have to look into it more. |
Does this need to remain open at this point? |
I don't think that will happen anymore as NodeJs 8 is EOL and 10 is in maintenance. |
@psmarshall During NodeJs diagnostics summit improvements/fixes in v8 CPU Profiler have been presented.
Is it planned/possible to backport them to Node.JS 10 or even 8 or is the difference in v8 to bit to do so?
Not sure if this is feasible, but if I could get some pointers on where to start and which commits to cherry-pick I'm happy to help in this.
The text was updated successfully, but these errors were encountered: