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
Error.captureStackTrace() performance regression in v7.x #11343
Comments
|
Known V8 issue: https://bugs.chromium.org/p/v8/issues/detail?id=5962 Not much we can do except perhaps back-port the fix once it materializes. |
|
Does this performance regression actually affect anything in production? |
|
@hashseed Module that instrument production code use it to retrieve userspace callsite (opbeat for example) |
|
I see. Is it possible to subclass Error to achieve the same? |
|
Closing because v7.x is EOL. Please comment or re-open if this should remain open. Thanks! |
|
@Trott this is still an issue on node 8. This microbenchmark takes about 3 seconds on node 8.2.1 and about 370ms on node 6.11.1: for (let i = 0; i < 100000; i++) {
Error.captureStackTrace({});
}That said, the issue was recently fixed in V8: https://bugs.chromium.org/p/v8/issues/detail?id=5962 So this will be fixed whenever node pulls in the fix. |
Original commit message:
[error] Lazy stack trace formatting for Error.captureStackTrace
This reinstates the old behavior of Error.captureStackTrace prior to
4feafee9d9. Like the builtin Error constructors, captureStackTrace now formats
the stack trace lazily once it is accessed.
Bug: v8:5962
Change-Id: I03821b73d26b7b40809a1fea98f9c820bfa05d6b
Reviewed-on: https://chromium-review.googlesource.com/574530
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{nodejs#46727}
Fixes: nodejs#13048
Fixes: nodejs#11343
|
This is fixed on master. As soon as v8 6.1 is merged and released (very soon) it is going to be fine again. I am therefore closing this. |
Error.captureStackTrace()is about 10 times slower in v7.5.0 than in v6.9.5.In particular this impacts bluebird in
NODE_ENV=developmenti.e. whenlongStackTracesare active.The text was updated successfully, but these errors were encountered: