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
io_buffer.rb, request.rb - improve handling with a body array/enumeration #2696
Conversation
PR #2595 (08-Apr) included code to test performance with three types of response bodies, array, chunked, and string. Quite a few code optimizations later, I've ran tests on the code here. The code was run with Note that the code uses files from both #2694 and #2695, so I'll wait for those... Speed comparison PR vs MasterThis PR:
Master:
|
I've been working on all these files, adding comments, renaming methods, fixing some bad initial decisions for parameters, etc. Closing, almost finished with updates. Happy New Year! |
Description
Improve the speed of assembling the response. Tested using the script in PR #2695, running 3 sets, with the rackup files to generate an array body response, a chunked body response, and a single string element body response. All three were approx 50kB in size, the first two having ~ 50 'elements'.
Note that the current code has a small memory leak with the array and chunked rackup files, which does not occur with the PR code.
Summarizing the req/sec (RPS), there is significant improvement:
The detail below also shows improvement in wrk's 'Request time distribution'.
wrk overload results
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.