6 ms·
When counting lines in Ruby randomly failed deployments
- ilyazub 3y agotl;dr: str.count($\) was 1.5x faster compared to str.lines.count and didn't allocate additional memory.
- ilyazub 3y agoThanks to `@Freaky` from Reddit for the wonderful feedback which led him to significantly improving `String#count` which be potentially included to Ruby: https://www.reddit.com/r/ruby/comments/16d4ha6/comment/k1f5mc6/?utm_source=share&utm_medium=web2x&context=3 https://www.reddit.com/r/ruby/comments/16d4ha6/comment/k1f5m...