turion / rhine

Haskell Functional Reactive Programming framework with type-level clocks
http://hackage.haskell.org/package/rhine
117 stars 21 forks source link

Parallelisation by default in State Automata? #308

Open turion opened 2 months ago

turion commented 2 months ago

In https://github.com/turion/rhine/pull/299/files/f8f72050f4c69ad74864370738e9ef90a86ce3eb#diff-6421dff49f75037ffc55f3a3ceeed8653e196c490d41d5601a55d30a5d69525b I proposed, that when dunai MSFs are replaced by automata, we could by default use GHC parallelism (par and pseq) whenever automata are combined, with ***, &&&, <*>, or even with >>>/..

With *** it's straightforward, but Arrow syntax doesn't usually desugar to it. Therefore the more aggressive optimization attempt is >>>, although it will often have data dependencies that will prevent parallelism.

It should be measured with a few realistic benchmarks whether this is actually an optimization, or even a pessimization.

Another place to check for optimization gains would be the particle filter in rhine-bayes.