LoginSignup
4
4

More than 5 years have passed since last update.

Python 3.4 って早くなったのかなと思ったけど遅くなってた

Posted at

職場の Windows 7 に入れている Python を 3.4.0 にしたら高速化した気がしたのですが気のせいでした。実行時間のテストがいけてなかったらごめんなさい。

C:\pyworks>C:\Python34\python.exe -m runtime_test
1401870117.465672
1401870127.773703
Runtime is 10.308

C:\pyworks>C:\Python33\python.exe -m runtime_test
1401870129.476873
1401870139.385864
Runtime is 9.909

C:\pyworks>py -m runtime_test
1401870167.25
1401870175.41
Runtime is 8.167
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
     import time
     time1 = time.time()
     print(time1)
     process()
     time2 = time.time()
     print(time2)
     time = float(time2 - time1)
     print("Runtime is {0:.3f}".format(time))

def process():
     for d in range(1000):
          x = sum(i for i in range(100000))

if __name__ == '__main__':
     main()
4
4
0

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
4
4