-
Notifications
You must be signed in to change notification settings - Fork 339
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
Improve URI module efficiency #184
Conversation
@DavidAntaramian @SViccari would you mind reviewing? |
@asummers this definitely goes away with your changes being pulled in, right? |
It would. Any performance problems would be the purview of the dependency library. |
@fastjames have you looked at this URI library we're talking about at all? Any indication it suffers some of the same problems? |
@fastjames I'm closing since it's outdated (we're using a dependency library), but thanks for the contribution. Let me know if you have an answer to my previous question at all. |
@joshsmith sorry for the delay -- it looks like the dependency library uses reduce |> reverse, so it should be fine. |
Thanks for the update @fastjames! |
The Stripe.URI module used a less-efficient method for building the HTTP query params string. Here, we switch to a more efficient list prepend and reverse pattern. Also, the recursive parser made use of Enumerable.impl_for/1 which is fairly heavyweight. By checking for maps or lists (which are assumed to be keyword lists) we can remove impl_for. I wish I could DRY up that check, but the small difference between the guard and non-guard syntax prevents it.
Addresses #105