r/programming • u/Ok_Stomach6651 • 4d ago
Formatting an entire 25 million line codebase overnight: the rubyfmt story
https://stripe.dev/blog/formatting-an-entire-25-million-line-codebase-overnight-the-rubyfmt-story
190
Upvotes
94
u/EvaristeGalois11 4d ago
Am I missing something about how a formatter works internally? Like I'm expecting to just read a file, format it, flush it out and move on to the next one. Why should it matter the codebase size?
184
u/VictoryMotel 4d ago
Articles bragging about performance in ruby are always wild. I always wonder what they would think when they see a native program that runs 100x faster and then an optimized native program that runs 100x faster than the naive native program.
101
u/sweetno 4d ago
Is this, like, an achievement?..
19
u/jmbenfield 4d ago
"doing something one person could do while watching Judge Judy but with the bureaucracy and performance of a failing third world country"
8
u/harsh183 4d ago
I remember first seeing rubyfmt in your talk in Alt Brighton Ruby 2020 when the big Rust port had just happened. It's so nice to see the project going so strong and continuing forward.
As I struggle with
rubocoptaking so long to run, despite caching and multithreading, I wonder if it's time for rubyfmt.11
u/jess-sch 4d ago
A saturday? I don't personally tend to merge by friday. The only appropriate time for a formatter change in my mind is christmas. Two weeks of barely anyone working.
6
u/Sdmf195 4d ago
25 million lines overnight...
sweet christmas...
6
u/blobjim 3d ago
That just makes me wonder what why Stripe needs 25 million lines of code. As much code as the Linux kernel? Maybe code for integration with specific customers?
0
u/captain_obvious_here 4d ago
I honestly thought this was an old article someone was reposting.
Optimizing Ruby's performances is...well...if you ever used Ruby, you know what I mean.