-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/basic.ds gets much worse #118
Comments
Thanks for reaching out! You are right,
Cozy always prefers to optimize query performance over update performance. Cozy has found the fastest possible implementation of In that light, what Cozy is doing is actually sort of reasonable. The synthesizer is trying to avoid the O(n) cost of
To do this, Cozy needs Many of the insanely long If you add a precondition to
See above: Cozy introduces the extra members to help implement
Day-to-day development has mostly stopped since I no longer work on Cozy full-time. For the past two years or so @izgzhen has been keeping the lights on and prototyping some new ideas. I have some ambitious ideas for improvements, but right now (as you discovered) Cozy is very unpredictable and remains more "research prototype" than "useful tool". :(
I watch GitHub like a hawk, so you've found the best channel for communication. |
Wow, okay, thanks for your explanation. I didn't realize Bag was so inefficient. If I was trying to optimize this in the same way, I would immediately reach for something like Map<T, Int> where the value is the number of copies, along with a special iterator that replicates each key as many times as necessary. I'm aware that that would take more space if all the elements are unique. So, it seems like a good solution would be to just give it a better implementation of Bag? |
Agreed, that is likely the best path forward. (A bit more context: as tool implementor, I often had to choose whether to spend my time improving Cozy's core synthesis algorithm or giving it more built-in knowledge. I have always fallen on the side of improving the synthesis algorithm rather than giving Cozy a better data structure library, and that may have been the wrong choice. It would be nice to spend a lot of time thinking deeply about Cozy's data structure library if I ever get a chance.) |
I'm really excited about the concept of collection optimization and synthesis, but I'm a little confused about a few things.
First, examples/basic.ds is mentioned in the readme as a good starting point, but why? It seems pretty clear to me (I don't have a proof) that basic.ds cannot get any better. If Cozy (even working correctly) cannot make any improvements to this example, why is it the first example you point people to?
Second, Cozy seems to make it much much worse. I thought it might be a regression, but I've gone very far back into the git history, and it produces garbage like this every time:
What is going on here? Dead code elimination seems to be totally broken (_var23 is the only state used by the query, all the other states and updates to them should be deleted), but also, why are any of these things ever chosen in the first place? Not a single one of them could possibly improve on the efficiency of any of the queries.
This project doesn't seem very active anymore. Is there any more development effort happening? Is there a better channel for communication?
The text was updated successfully, but these errors were encountered: