-
Notifications
You must be signed in to change notification settings - Fork 30
Conversation
👍 Fantastic, thanks! |
👍 |
lookup k (Three _ _ _ _ _ _ right) = lookup k right | ||
lookup k tree = | ||
let comp :: k -> k -> Ordering | ||
comp = compare |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't immediately sure why you did this at first, but I get it. Nice. I'll definitely do some work on this one day 😉
I just tried the 0.5.5 release and I am getting the following on psc 0.7.6.1:
Was this a breaking change from 0.5.4? |
Argh, it wasn't supposed to be. Looks like it's the multi-valued case, I thought that went in before 0.8. @natefaubion perhaps we should use a record/array literal there for now, and then remove again when we make the release for psc 0.8? |
I've just reverted it for now, I did a version using records and arrays but then was greeted by a bunch of partial pattern warnings. Perhaps there is something we can do pre-0.8 still though. |
I would have sworn that as well. I think records should work (you're just doing useless allocations :/). Arrays will always give you the partial warnings. You could also use other functions, but that may be slower since you can't use |
Both Do we want to update |
Sounds good to me, thanks for looking into this again. |
This PR improves the performance across the board by better optimizing the sharing on pattern matches. There were a lot of duplicate checks for things like
==
and<=
in guards. In my tests, about a 2x speedup overall. Ideally, a smarter pattern matcher could perform these optimizations, but for now we can do it manually.