3 ms·
Unpacking (or splatting) can be excruciatingly slow in Julia if you have more than a few dozen elements in the iterable. That happens because it gets splatted
by jakobnissen 6y ago
Unpacking (or splatting) can be excruciatingly slow in Julia if you have more than a few dozen elements in the iterable.
That happens because it gets splatted into a tuple with N elements, which in Julia has a type parameter for every element - i.e. a generic type Tuple{N1, N2, N3 ... N} with as many type parameters as there are elements in the iterable. And the compiler has a hard time working with an instance of a type with e.g. 10,000 parameters.