I have an idea for a performance optimization, whi...
# lucee
f
I have an idea for a performance optimization, which admittedly feels a bit like saving the world through paper straws, but I’ll share it anyways… I noticed in the lucee source code that arrays appear to be backed by Java’s ArrayList, and the Lucee’s initial capacity for the backing ArrayList is hard coded to 32. In the JDK source code for Java< 8 the initial capacity was defaulted to 10, but then in Java 8 as a performance optimization they changed the default to be a 0, so it doesn’t create the internal backing array unless elements are actually added to the array. The question I suppose is how many times do we create an array that is empty, and we don’t end up adding any elements to it? Internally Lucee creates an array with a capacity of 32 when we create an “empty array”
👍 3
👍🏻 1