Will a LinkedList be faster? Should I swap the for each
with an iterator
? Should this ArrayList
be an Array
? This article came to be in response to an optimization so malevolent it has permanently etched itself into my memory.
Before going heads on into Java and the ways to tackle interference, either from the garbage collector or from context switching, let's first glance over the fundamentals of writing code for your future self.
Premature optimization is the root of all evil.
This article is published at https://wasteofserver.com/premature-optimization-where-software-thrives-unless-you-kill-it-first-a-tale-of-java-gc/, you can read the rest there.