-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
buffer.write performance issue #35386
Comments
Update:
Any thoughts on what other options to try? For the short term, and since performance hit is so great we're calling |
|
@nodejs/v8 is there a way to improve the inlining for cases like this one? And could the |
@BridgeAR - I tried removing
|
I wonder if hiding the validator frames is worth the performance cost (if I am reading the profiling results correctly) |
I wrote this benchmark. Its baseline result for latest
With the following implementation
it shows:
So, there is a certain penalty introduced by Update. I've tried re-running the benchmark and I can no longer see any difference, so please ignore this message. Disabling inlining with |
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: nodejs#35386
In fact, this is significant enough only for the shortest and simplest library calls, @ledbit 's example uses 8 bytes buffers, but still, why not |
Add @puzpuzpuz's benchmark for the new implementation of hideStackFrames Refs: nodejs#35386 Refs: nodejs#35644
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: nodejs#35386
Add @puzpuzpuz's benchmark for the new implementation of hideStackFrames Refs: nodejs#35386 Refs: nodejs#35644
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: nodejs#35386
Add @puzpuzpuz's benchmark for the new implementation of hideStackFrames Refs: nodejs#35386 Refs: nodejs#35644
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: #35386 PR-URL: #35644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: nodejs#35386 PR-URL: nodejs#35644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: nodejs#35386 PR-URL: nodejs#35644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Eliminate all overhead for function calls that are to be hidden from the stack traces at the expense of reduced performance for the error case Fixes: #35386 PR-URL: #35644 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
What steps will reproduce the bug?
I have not been able to create an isolated example outside of the application that reproduces the perf degradation - likely due to optimization.
When profiling our application (Cribl LogStream) we noticed that the top function call was a function called
hidden
- after some digging it turns out that the call trace is something like thisafter modifying the application to all the undocumented
Buffer.utf8Write
instead ofBuffer.write
we see about 20% overall improvement and the heavy bottom profile looks like follows - note during both times the application was profiled for same amount of time (30s).I noticed the same performance improvement after updating hideStackFrames to look like this:
I have not been able to reproduce the perf degradation using a script that isolates just
Buffer.write
operations. I don't even see thehidden
function calls at all during profiling. However, when I set a breakpoint inhideStackFrames
and then start profiling I do end up seeinghidden
in the profile - which make me think there's some optimization/compilation/inlinning issue at play.UPDATE 9/28
I was able to repro the perf degradation by disabling inlining
here's how
buffer.js
looks likeCould this mean that the default V8 inline settings are too conservative for the server side?
The text was updated successfully, but these errors were encountered: