If it’s not mandatory that the list be an ArrayList
:
Long[] array = new Long[100_000_000];
Arrays.parallelSetAll(array, Long::valueOf);
List<Long> list = Arrays.asList(array);
I have not done any time measurements. The list will be modifiable in the sense that you can set values, but it has fixed size, there is no adding or removing.
If you do need a variable-size list, you may try:
List<Long> list = new ArrayList(Arrays.asList(array));
It somewhat defies the idea of exploiting parallel execution, though, and I am no longer sure about how the speed would compare to what you have already got.
Edit: If the list doesn’t need to be modifiable at all, make your own “list” implementation that doesn’t store any actual data and calculates the value each time an element is asked for. Then initialization will take no time. You can subclass AbstractList
for this purpose.