fraxl icon indicating copy to clipboard operation
fraxl copied to clipboard

Remove vinyl dependency

Open gmalecha opened this issue 6 years ago • 10 comments

This removes the dependency on vinyl which seems to have compilation errors with recent versions of GHC.

gmalecha avatar Feb 12 '18 17:02 gmalecha

Hey thanks! The reason I haven't done this myself is that we really need Data.Union to have the same performance as Data.OpenUnion from freer-effects. Granted, the current implementation of Data.Union is not a regression from the vinyl-plus that fraxl used to use, but the performance of freer-effects's union type was a pretty major innovation in the performance of extensible effects.

Also, I would prefer not to use default-extensions in the cabal file. It obscures information to the reader, and this is primarily a research package after all ;)

ElvishJerricco avatar Feb 13 '18 01:02 ElvishJerricco

Oh, I see you implemented Data.Union yourself here. I had assumed you'd used the union package, which I believe is identical to what you've made. Depending on that package would be better, especially since it has a module namespace conflict with this.

ElvishJerricco avatar Feb 13 '18 01:02 ElvishJerricco

Thanks. I was having trouble with vinyl in my setup for some reason and union also uses it. The strictness annotations are a good point though. Even with that, Data.Union is probably a lot slower than the implementation from freer-effects (which is heavily optimized). Perhaps I will switch to that one.

gmalecha avatar Feb 13 '18 23:02 gmalecha

Yea, I think we need to have a conversation with the author of union to see if they'd be willing to sacrifice the nice, pure implementation of union in favor of the much faster implementation in freer-effects. If they're willing to do that, then we should just depend on union. But otherwise, we'll have to see if we can work with the freer-effects authors on getting their union factored out into a Hackage package somewhere.

ElvishJerricco avatar Feb 14 '18 23:02 ElvishJerricco

Closing this in favor of the CoRec type from vinyl until we find a constant time solution.

ElvishJerricco avatar Jul 19 '18 22:07 ElvishJerricco

This stuff is all a bit above my pay grade but have you looked into fastsum? I think it does some TH to trade compile time for fast runtime. As long as you don't have to rebuild it, it is supposed to be pretty fast.

MichaelXavier avatar Aug 26 '18 20:08 MichaelXavier

Thad does seem quite good. I dislike taking the namespace Data.Sum, but that's minor. I'm not convinced that vinyl's CoRec couldn't be made to have faster operations that we need, but it seems pretty nontrivial. So I would probably welcome a PR switching to fastsum.

ElvishJerricco avatar Aug 27 '18 02:08 ElvishJerricco

I think its probably above my abilities to benchmark and add that. I'm sure what you have now is plenty fast for my needs, just wanted to see if you'd seen fastsum and if it would solve any problems.

MichaelXavier avatar Aug 27 '18 03:08 MichaelXavier

I have a pretty tenuous understanding of the pieces involved but I was actually able to drop vinyl and replace it with fastsum and ran some benchmarks and saw a small performance increase in some cases.

On master:

stack bench --benchmark-arguments="seql 1000000"
# 18.82s before
stack bench --benchmark-arguments="seqr 1000000"
# 7.00s
stack bench --benchmark-arguments="tree 20"
# 19.17s

With fastsum:

stack bench --benchmark-arguments="seql 1000000"
# 15.79s
stack bench --benchmark-arguments="seqr 1000000"
# 7.08s
stack bench --benchmark-arguments="tree 20"
# 17.98s

This could be coincidental, the benchmarks are only running once, but I'll throw together a PR for you to review.

MichaelXavier avatar Aug 28 '18 02:08 MichaelXavier

Can this please be released? Or the upper bound on vinyl relaxed?

christian-marie avatar Feb 07 '19 04:02 christian-marie