TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

When counting lines in Ruby randomly failed deployments

2 pointsby ilyazubover 1 year ago

2 comments

ilyazubover 1 year ago
Thanks to `@Freaky` from Reddit for the wonderful feedback which led him to significantly improving `String#count` which be potentially included to Ruby: <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;ruby&#x2F;comments&#x2F;16d4ha6&#x2F;comment&#x2F;k1f5mc6&#x2F;?utm_source=share&amp;utm_medium=web2x&amp;context=3" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;ruby&#x2F;comments&#x2F;16d4ha6&#x2F;comment&#x2F;k1f5m...</a>
ilyazubover 1 year ago
tl;dr: str.count($\) was 1.5x faster compared to str.lines.count and didn&#x27;t allocate additional memory.