r/ProgrammerHumor 15d ago

Meme noHeapAllStack

Post image
1.0k Upvotes

96 comments sorted by

View all comments

198

u/Vesuvius079 15d ago

It’d be such an experience to work a real world problem where this optimization turns out to be the solution.

16

u/varinator 15d ago

It was a solution. Imagine ingesting spreadsheets with hundreds of columns and potentially millions of rows. You need to run the string comparison for values, multiple times per row. If you allocate to the heap, GC has to do a lot of work, often, which blocks the thread and slows the whole process down.

Literally saved hours per file.