top | item 37430699 When counting lines in Ruby randomly failed deployments 2 points| ilyazub | 2 years ago |serpapi.com 2 comments order hn newest ilyazub|2 years ago Thanks 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/k1f5m... ilyazub|2 years ago tl;dr: str.count($\) was 1.5x faster compared to str.lines.count and didn't allocate additional memory.
ilyazub|2 years ago Thanks 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/k1f5m...
ilyazub|2 years ago tl;dr: str.count($\) was 1.5x faster compared to str.lines.count and didn't allocate additional memory.
ilyazub|2 years ago
ilyazub|2 years ago