-
Notifications
You must be signed in to change notification settings - Fork 199
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
HTTP Header Creation Performance #10
Comments
Is this still applicable? If so whereabouts does it calculate the length? |
Ah yeah I think so. |
Is there something we can use to test the performance increase / benefit? |
Could do some math and calculate how many instructions you would save given an average string length or something...but the performance increase would be minimal, just trying to save some useless cycles. |
Did some ab testing: asmttpd
nginx
But got disappointed after testing the same website in the browser. I saw firefox load asmttpd in 17 seconds vs nginx with 5 seconds. |
Thanks for those stats - very interesting! |
Interesting! I think it would need to use asynchronous i/o (epoll) to compete with things like nginx. I have an old issue [ #9 ] for it, but it's a ton of work. |
I am very slowly working on this ;) |
awesome you work on it anyway, I thought maybe we can use some other asm multi-tasking example. But did not find any. |
The only way I can figure out to improve the concat function is to add two new concat functions, one for when you have a dest length already (removes need to use get_string_length at beginning), the other for when you have the src length (removing need to calculate the string length obviously). In httpd.asm we would make use of the server_header_len, content_length_len etc. Each new function would only use get_string_length once instead of twice compared to the regular concat. I might be missing something really obvious here so please tell me if I am! The method I described above would save 1 call to get_string_length in the add_content_type_header, 3-4 on average in each create_httpXXX_response. Thoughts @nemasu? |
@triforce Yeah, I believe that's what I had in mind, string_concat doesn't need to calculate the length of the string if we pass the length as a parameter. Might even be able to get rid of the last get_string_length in the create_httpxxx_repsonse functions too if we're keeping a running total. |
Need to improve performance of header creation.
Make a concat function that takes in an offset of destination string.
This way it wont need to calculate the length every time it adds a header.
It returns the new length already, so we can easily keep track of the length as creation happens.
The text was updated successfully, but these errors were encountered: