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

CGI::Parse::PSGI::parse_cgi_output optimization idea #15

Open
bambr opened this issue Dec 29, 2016 · 0 comments
Open

CGI::Parse::PSGI::parse_cgi_output optimization idea #15

bambr opened this issue Dec 29, 2016 · 0 comments

Comments

@bambr
Copy link

bambr commented Dec 29, 2016

Hi Tokuhiro,
Thank you for your work on PSGI.

I had a problem with memory consumption on CGI::Parse::PSGI::parse_cgi_output and looked inside. I suggest to split support for filehandles and scalar refs into 2 separate subs and to stop using HTTP::Response. The code provided is about 13 times faster on small response (8K) and 15% times faster on large response (about 10Mb). Also the memory consumption is reduced on 15% on large response (and in becomes really great when we inline this code to avoid copying $stdout_buffer).
What do you think about this code/idea?
parse_cgi_output.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant