$ ghc temp.hs
Note
Don't use -O2
when build temp.hs
, would stack overflow.
ghc is 10X faster then gevent.
$ time python temp.py 100000 python temp.py 100000 3.22s user 0.26s system 99% cpu 3.499 total $ time ./temp 100000 ./temp 100000 0.30s user 0.08s system 99% cpu 0.379 total $ time ./temp 1000000 ./temp 1000000 3.98s user 0.57s system 99% cpu 4.595 total
$ python temp.py 100000 601M $ ./temp 100000 184M $ ./temp 1000000 1.73G