FWIW, there was a 10x difference between Julia-0.4.0-dev-8fc5b4e605 (Apr 5
version) and Julia-0.4.0-dev-dea3d0e420.app (today). So makes sure which
nightly you are comparing.
(this is an Mac 10.9.5 early 2013 macbook pro)
Julia-0.4.0-dev-8fc5b4e605.app => 120 ms
Julia-0.4.0-dev-dea3d0e420.app => 17 ms
Python 2.7.8 shows 8ms similar to your numbers
On Thursday, April 30, 2015 at 4:53:44 PM UTC-7, Ali Rezaee wrote:
>
> 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,
>>
>