Hacker News new | ask | show | jobs
by mitmatt 4993 days ago
I just ran Wes's benchmarks (not the BLAS call versions) on my machine with a Julia I built on 10/13 (17c3c13), and the timings have indeed improved. For the details, see this gist: https://gist.github.com/3901139 (including the comment I posted on it).

The highlight is

numpy: (x * y).sum() => 41.1 ms

julia: inner(x,y) => 37.4 ms

julia: x*y => 19.5 ms

cython: inner(x,y) => 13.8 ms

The numpy and Julia versions are much easier to write and run.

Disclaimers: I've never written or built cython code before just now, and I think Julia is the coolest.

EDIT: whoops, missed the most important one (inner() written in pure Julia). Added it. Any thoughts on why inner() in Julia isn't faster?

1 comments

Nice. Thanks for running those. The reason inner isn't faster is probably that we do bounds checks on every array access. This is surprisingly inexpensive on modern hardware but it still takes some time. We're working on a couple of things to address this: generating code so that llvm can more easily hoist bounds checks out of loops, and allowing turning bounds checking off entirely for blocks of Julia code.