vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.76k stars 196 forks source link

Add a faster case if BigArrayBigList.of() (no arguments) is called. #230

Closed techsy730 closed 3 years ago

techsy730 commented 3 years ago

Instead of newly creating an empty big array, now it fallsback to the default constructor. This will allow it to have much better resizing performance, as instead of 0->1 on first add, it will go 0->10 (because of DEFAULT_EMPTY_BIG_ARRAY being used now).

The array based of remains the same; we need to ensure the same runtime type is kept, even if empty.

Also minor doc updates to ArrayList as well.