Y
Hacker News
new
|
ask
|
show
|
jobs
When counting lines in Ruby randomly failed deployments
(
serpapi.com
)
2 points
by
ilyazub
1017 days ago
2 comments
ilyazub
1004 days 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...
link
ilyazub
1017 days ago
tl;dr: str.count($\) was 1.5x faster compared to str.lines.count and didn't allocate additional memory.
link