Skip to content

Headers parsing performance optimization #366

merged 1 commit into from Nov 17, 2012

2 participants

bogdan commented Mar 6, 2012

Among other tiny changes this PR contains the following optimization:

-        selected = select_field_for(
-        if selected.any? && limited_field?( 
+        if limited_field?( && (selected = select_field_for( && selected.any?

This allows select_field_for(that is pretty slow when number of headers is high) be called only when limited_field? returns true.

About 30% performance improvement for method when there are a lot of unknown headers.

mikel commented Nov 17, 2012

Nice, thanks :)

@mikel mikel merged commit bced96d into mikel:master Nov 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.