-
Notifications
You must be signed in to change notification settings - Fork 115
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
Test using the prettyprinter library for rendering SQL #436
Conversation
since Purely Agile Limited doesn't exist any more
Fixes tomjaguarpaw#434 Thanks to @csasarak for discovering this, benchmarking, and pointing me to the source of the problem.
981fee9
to
3c11cac
Compare
Actually, for fun I tried using this in my real application and it's a bit quicker. I will try to think of some better benchmarks than what I was testing with before. |
Can you explicitly import
This definitely looks like the right approach. I'm happy to provide guidance. What would you like guidance on? I would suggest a few
Basically let's try to get the diff to be as small as possible. |
@tomjaguarpaw I meant exactly what you've done, thanks! I want to make sure this change doesn't break things so I tried to limit the text stuff to its own set of functions in the One question I have is why I will incorporate your suggestions, thank you! |
The two modules are separate because the |
3c11cac
to
1347880
Compare
You can change the types from One thing we need to consider is what is actually the correct type of thing to create in the first place. |
I may give that a try next then. I have reduced the diff size and pushed, though some things I kept changed into forms that match the way |
It would still be good to see |
In fact if you can |
You're right here, probably not much gain to be had.
That is true, and its the approach I've taken now. The nice thing is that now that we have this code creating a |
e9fd568
to
95af710
Compare
I've done my best to reduce the number of changes made to the body of those modules. I have also opened an issue with prettyprinter to gauge their interest in merging a bytestring renderer, unless you think this is the wrong approach. |
I pushed https://github.com/tomjaguarpaw/haskell-opaleye/tree/prettyprinter-test. It makes zero changes in the body of the printing modules. Now that we've got to that point feel free to build on top and go crazy optimising as much as you can! |
Thank you! I will see what I can do. |
462061f
to
e1a8d6c
Compare
This is a test based on the discussion in #435. My benchmarks (on a relatively simple query) show it to be a bit faster than the old one. I want to try using the
fuse
function fromprettyprinter
to see if that can help since many of the printing functions add a few relatively small things to the append.It's pretty rough, and if this is a direction we're interested in going I'll need some guidance on design.