Skip to content
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

perf: Serialize error stack only when needed #1359

Merged
merged 2 commits into from
Jun 4, 2021
Merged

Conversation

aivopaas
Copy link
Contributor

Improving Error stack serialization performance when showFriendlyErrorStack=true.

With current implementation there's about 30% overhead because the stack trace is serialized even when it's not actually needed.

With proposed change the overhead is somewhere between 1-5% on Node 14. There were improvements related to stack trace serialization in Node 12.

On the attached benchmark results, first run is on old code, second run on new code. Benchmark code also committed.

image

@aivopaas aivopaas marked this pull request as ready for review May 31, 2021 12:44
@aivopaas
Copy link
Contributor Author

Opened issue #1361 for the discussion

@luin luin linked an issue Jun 4, 2021 that may be closed by this pull request
@luin luin merged commit 62b6a64 into redis:master Jun 4, 2021
@luin
Copy link
Collaborator

luin commented Jun 4, 2021

Awesome! Thanks for the contribution!

ioredis-robot pushed a commit that referenced this pull request Jun 4, 2021
## [4.27.4](v4.27.3...v4.27.4) (2021-06-04)

### Performance Improvements

* Serialize error stack only when needed ([#1359](#1359)) ([62b6a64](62b6a64))
@ioredis-robot
Copy link
Collaborator

🎉 This PR is included in version 4.27.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

janus-dev87 added a commit to janus-dev87/ioredis-work that referenced this pull request Mar 1, 2024
## [4.27.4](redis/ioredis@v4.27.3...v4.27.4) (2021-06-04)

### Performance Improvements

* Serialize error stack only when needed ([#1359](redis/ioredis#1359)) ([62b6a64](redis/ioredis@62b6a64))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PR #1359 to improve Friendly Error Stack performance
3 participants