Comment

Comment by gmfawcett

Good lord, this long-winded writing style is maddening to read!

Here's what he changed:

> Set<Thing> aSet = new HashSet<Thing>();

to:

> Set<Thing> aSet = new HashSet<Thing>(0);

His explanation:

"Most of these sets were empty for the entirety of their life, but each one was consuming enough memory to hold the default number of entries. Huge numbers of these empty sets were created and together they consumed over half a gigabyte of memory. Over a third of our available heap."

I'm not sure he ever got around to explaining how it saved "half a million dollars", though.

parent gmfawcett 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton