Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's a quick benchmark on my machine (a EeePC 1001HE). I used reduce1 with clojure-py because there doesn't seem to be a reduce BIF. I don't know if that effected this benchmark any:

Python:

    (time (reduce1 + (range 100000)))
    Elapsed time: 3882.57193565 msecs
    4999950000
PyPy:

    user=> (time (reduce1 + (range 100000)))
    Elapsed time: 259.984970093 msecs
    4999950000
Clojure via Java Hotspot:

    user=> (time (reduce + (range 100000)))
    "Elapsed time: 75.35225 msecs"
    4999950000


Those numbers a re bit small to get a full view of the way the pypy jit works:

  user=> (time (reduce1 + (range 100000)))
  Elapsed time: 903.011083603 msecs
  4999950000
  user=> (time (reduce1 + (range 1000000)))
  Elapsed time: 777.748823166 msecs
  499999500000
  user=> (time (reduce1 + (range 10000000)))
  Elapsed time: 8764.57095146 msecs
  49999995000000
  user=>

  Clojure via hotspot:
  user=> (time (reduce + (range 100000)))
  "Elapsed time: 174.768593 msecs"
  4999950000
  user=> (time (reduce + (range 1000000)))
  "Elapsed time: 267.60421 msecs"
  499999500000
  user=> (time (reduce + (range 10000000)))
  "Elapsed time: 1131.77367 msecs"
  49999995000000
  user=>
But yes, we still have some room for improvement.


Here's a blog post explaining the issues involved in a bit more detail: http://clojure-py.blogspot.com/




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: