SpectralSequences / sseq

The root repository for the SpectralSequences project.
Apache License 2.0
22 stars 10 forks source link

Clean up gating on `concurrent` feature #140

Closed JoeyBF closed 8 months ago

JoeyBF commented 8 months ago

I was able to contain all the gates in a new maybe-rayon crate. When concurrency is enabled, it is a thin wrapper around the rayon API, or at least the part of the API that the rest of the codebase uses. When it is disabled, the crate provides the same API except that the implementation is completely serial, and doesn't depend on rayon.

Every feature gate is now either in maybe-rayon, in some comments in the steenrod example, or in the resolve_concurrent benchmark.

By unifying some parts of the code, it happens that serial operations now needlessly communicate via mpsc channels. Also, secondary computations now unconditionally compute intermediates upfront, but that's simply a reordering of the same operations as previously. As far as I can tell, performance is unchanged.