0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Julia vs Python 速度比較

Last updated at Posted at 2022-07-28

結論) 単純演算で約5.6倍(コンパイル含む)。

マシンスペック

  • Mac mini (2018)  
  • 3.2 GHz 6コアIntel Core i7  
  • 64 GB 2667 MHz DDR4  
    # Julia 1.7
    a =0
    @time for i in 1:100000000
       global a = π/π/π
    end
    println(a)
     #  2.984761 seconds
     #0.3183098861837907
    # python 3.7
    import time
    import math
    
    a =0
    startTime = time.time()
    for i in range(100000000):
       a = math.pi/math.pi/math.pi
    print(time.time()-startTime)
    print(a)
    
    #  16.685441732406616 seconds
    # 0.3183098861837907

ちなみに数回やっておおよそ5倍程度は違いがありました。

参考図書

1から始めるプログラミング

Juliaプログラミングクックブック

天才プログラマー タンメイが教える Julia超入門

0
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?