项目作者: mxrguspxrt

项目描述 :
Speed and memory consumption of Go vs Crystal vs Ruby vs Python2 vs Python3
高级语言: Python
项目地址: git://github.com/mxrguspxrt/TenMillionObjects.git
创建时间: 2017-10-03T23:05:34Z
项目社区:https://github.com/mxrguspxrt/TenMillionObjects

开源协议:

下载


Why?

To test different languages and environments, how they handle creating ten million objects with one instance variable (string “tere”).

OOP is beautiful and a software engineer should be able to create objects without being concerned about memory or CPU time issues.

Confirming the results

  1. cd benchmarks && ruby run-tests.py

Results

seconds
megabytes

  1. Go used 158MB and ran 1 seconds.
  2. Crystal used 429MB and ran 1 seconds.
  3. Ruby used 933MB and ran 6 seconds.
  4. Python3 used 1688MB and ran 14 seconds.
  5. Python2 used 3802MB and ran 22 seconds.

I do recommend to take a look at https://crystal-lang.org

Contributing

Make a PR and I merge.