-
Notifications
You must be signed in to change notification settings - Fork 173
improve composable-cache, converters and header parsing performance #1002
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
Conversation
🦋 Changeset detectedLatest commit: 93ef8d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
29b63bb
to
40a1b30
Compare
commit: |
} | ||
// Use Buffer.concat which is more efficient than manual allocation and copy | ||
// It handles the allocation and copy in optimized native code | ||
const buffer = Buffer.concat(chunks, totalLength); |
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.
64e30bf
to
0876873
Compare
Closing in favor of separate pull-requests. |
We saw that under high concurrency, Nth request was taking a lot more time than others. This was caused by the composable cache. Prior to this pull-request, cache was consuming all data stream (the response of the page), just to access it and later convert it to a stream (and discard the data cached). This created a lot of GC pressure and caused a lot of unnecessary memory usage.