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

Response#redirect? micro-optimization #986

Closed
wants to merge 1 commit into from

Conversation

ktheory
Copy link
Contributor

@ktheory ktheory commented Dec 21, 2015

This improves the performance of Response#redirect? by ~55% using a set instead of an
array.

See this gist for benchmarks.

tl;dr: The new method can run a million redirect checks in 151ms, vs. 338ms for the original method (with a 301 status, the fastest case).

Improve performance of `redirect?` by ~55% using a set instead of an
array.

See this gist for benchmarks:
https://gist.github.com/ktheory/e62bc43900745d54eb4f
@ktheory
Copy link
Contributor Author

ktheory commented Jul 17, 2017

I'm closing this to clean up old pull requests. I'm happy for someone else to advocate for this change; but it seems pretty fiddly & low-impact.

@ktheory ktheory closed this Jul 17, 2017
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.

None yet

1 participant