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

Adds an AVX2 option for the parser. #10

Closed
wants to merge 1 commit into from
Closed

Conversation

vkrasnov
Copy link

This gives significant performance boost on Haswell CPUs (compared to PCMPESTRI)
1.78X for bench.c up to 2X for some other on i5-4278U, with gcc 4.9.2 -O3 -mavx2 -mbmi2.
The change requires the entire parse_headers function to change -
instead looking for the next token, it now creates a bitmap of all tokens.
When compiled without -mavx2 it uses the old parse_headers.
The code was not tested much, so it might contain some bugs, I mostly
wrote it to check the performance potential of AVX2 for parsing.

This gives significant performance boost on Haswell CPUs (up to 2X).
The change requires the entire parse_headers function to change -
instead looking for the next token, it now creates a bitmap of all tokens.
The code was not tested much, so it might contain some bugs, I mostly
wrote it to check the performance potential of AVX2 for parsing.
@kazuho
Copy link
Member

kazuho commented Dec 18, 2014

Wow! This is very interesting.

I am not sure if I can maintain this, but it's definitely a wonderful work. Please wait while I look into it.

@Asmod4n
Copy link

Asmod4n commented Aug 18, 2015

any updates on this?

@kazuho
Copy link
Member

kazuho commented Aug 18, 2015

Sorry, I had thought that I had left my comment on this issue.

The code in PR looks great. It shows the true potential of what could be done by using SIMD instructions, and my kudos go to @vkrasnov for the work.

OTOH I am afraid I would not be capable of maintaining the code. The approach used in the PR is a big leap from string operations that the non-SIMD version of picohttpparser and the SIMD-optimized version based on PCMPxSTRx instruction use. And personally I dot have any practical issue in the level of performance achieved by the current implementation of picohttpparser.

Considering all the facts, I am inclined to not merging this PR, but keep it open so that others interested could notice the work.

@vkrasnov
Copy link
Author

@vkrasnov could volunteer if there was demand for it. But on my fork I see zero stars :)

@kazuho
Copy link
Member

kazuho commented Jan 4, 2016

@vkrasnov 👍

@thedrow everybody has the right to use @vkrasnov's fork (and as stated above, the reason I am keeping this issue open is actually to let people notice his work). And someday we might start using the fork in H2O as well.

@yesudeep
Copy link

Has this been merged?

@kazuho
Copy link
Member

kazuho commented Jul 15, 2020

We do not have a plan to merge this. HTTP/1 parsing performance is becoming less issue, as high volume traffic moves to HTTP/2 and /3. We think that the cost of maintaining the added complexity is not worth the performance benefit.

Of course, people are free to use a fork or create and maintain ones own.

@vkrasnov vkrasnov closed this Jul 17, 2020
@vkrasnov
Copy link
Author

Yeah, it has been open for too long, no reason to keep it now.

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

Successfully merging this pull request may close these issues.

4 participants