haskell / vector

An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework .
Other
359 stars 141 forks source link

lists vs pure vector vs monadic vector stream performance benchmarks #207

Open harendra-kumar opened 6 years ago

harendra-kumar commented 6 years ago

I tried benchmarking pure lists, pure vectors and monadic vector streams to see how they fare against each other. Surprisingly monadic vector seems to be doing better than the other two. I am puzzled why the pure vector is not as good as monadic version, I guess they both use the same underlying implementation. Are there some inlining issues? Or I am not benchmarking correctly?

The benchmark results can be seen here. Monadic vector benchmarking code is in Vector.hs and the pure vector benchmarking code is in PureVector.hs.

cartazio commented 5 years ago

@harendra-kumar you didn't test monadic vectors, you tested the underlying stream fusion mechanism.

that is, you wrote your computation in the internal representation used to improve performance!

your benchmarks dont include the monadic stream rep vs pure vector rep.

either way: i dont see the comparison in the links, you failed to give a stable url :(