[#]Ruby perf question: What's the fastest way to iterate over segments in an HTTP route? (ex. "/users/:id/postst/:post_id")
I currently .split on "/" and call .each on the array. I thought I could avoid creating an array and perhaps gain speed by "consuming" the string directly. I tried three ways.
The array is always faster. 🤔
Please boost to reach any big brains too busy to follow me. 😉
=> View attached media | View attached media | View attached media | View attached media
=> More informations about this toot | More toots from dcrossney@ruby.social
text/gemini
This content has been proxied by September (3851b).