by PartiallyTyped · 5y ago · 0 comments
My issue with python is speed, but I will probably end up implementing what I want/need in rust and call that from python.
Like what?
> or the huge bottleneck of unpacking (star operator in python)
In what sense is unpacking a bottleneck?
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.
@time v = [(1:10_000)...]; -> 0.000639 seconds
f(args...) = sum(args)
@time f(v...); -> 0.001039 secondsPerformance wise, I can't recall the exact scenario though.