Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wow -- that is some ugly code. Why couldn't they use a single varargs method declaration? Does this code need to support older Java versions that lack varargs support?


Read the code comments. ”The purpose is the reduction of the size of the bytecode.”


It may be a performance hack. Varargs results in an array being allocated. I've seen this trick in the past, but they usually stopped at a handful of arguments and let the rest be handled by varargs.


Groovy is chock-full of absurd little microoptimizations that will forever fail to make even the tiniest dent in the general overhead relative to java. For several years there was even an "assume equality of hashes match" shortcut hidden in certain set operation code paths.


When compiled statically groovy has almost zero overhead relative to Java. I appreciate how much effort they have made to keep the overhead low and reduce the bloat as much as they can.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: