I tried on a Linux desktop, and I still get similar timings. Does anyone
else get different timings?
On Friday, May 1, 2015 at 12:43:24 AM UTC+2, Ali Rezaee wrote:
>
> Dear all,
>
> I have a ported all my project from python to Julia. However, there is one
> part of my code that I have not been able to optimize much. It is between 3
> to 9 times slower than similar python code.
> Do you have any suggestions / explanations?
>
> Julia code:
> function collect_zip(a::Array=["a","b","c","d"],b::Array=[0.2,0.1,0.1,0.6
> ])
> c = collect(zip(a,b))
> end
>
> collect_zip()
> @time for i in 1:10000; j= collect_zip();end # elapsed time: 0.089672328
> seconds (9 MB allocated)
>
> Python code:
> def listzip(a = ["a","b","c","d"], b = [0.2,0.1,0.1,0.6]):
> c = list(zip(a,b))
> a = timeit.timeit("listzip()","from __main__ import listzip",number=10000)
> print(a) # 0.0105497862674
>
> P.S: I need to convert the zip to an array because after that I need to
> sort them.
>
> Thanks a lot,
>