luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.59k stars 156 forks source link

Optimize this section of building a path #1831

Closed jwoertink closed 6 months ago

jwoertink commented 1 year ago

With https://github.com/crystal-lang/crystal/pull/13798 merged in, Crystal 1.10 will now have the ability to pass an IO in to this method

https://github.com/luckyframework/lucky/blob/0bcc91f729c17c414796929d35e3f99aa8686334/src/lucky/routable.cr#L299

This Action.route method will need a small refactor, and using some macro version checks with the compare_version macro, but if we make path_from_parts take an IO, then we can pass that IO to HTTP::Params.encode and URI.encode_www_form which will be a small performance boost when generating any routes or paths