Skip to content
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

use cats-parse #339

Merged
merged 6 commits into from
Aug 31, 2021
Merged

use cats-parse #339

merged 6 commits into from
Aug 31, 2021

Conversation

gregor-i
Copy link
Contributor

I've continued the work of @nightscape in his PR.

I'd like to get some feedback before I will continue with cleaning up the code:

Error messages

The messages used parboiled's error responses. So they have changed. Ie:

cats-parse:
Invalid URL could not be parsed. Error(7,NonEmptyList(EndOfString(7,33)))

vs.

parboiled:
Invalid URL could not be parsed. Invalid input ':', expected _ip_v6_hex_pieces, ']', _ip_v6_hex_pieces_ending_colon or _ip_v4 (line 1, column 20):
http://[fefe:fefe:::8.8.8.8]:9000
                  ^

Performance

I've ran the benchmark and it seems like it got worse by a factor of 10:

with cats-parse
with parboiled

Correctness:

parboiled does backtracking by default and cats-parse does backtracking only on demand. So the translation might have changed the semantics of some rules. All tests are successful (on my machine), but there might be problems still undiscovered.

@theon
Copy link
Member

theon commented Aug 28, 2021

Thanks both for your work on this! I'll be able to take a proper look after the weekend.

I think the error messages changing is fine for now. We can always improve them on another PR.

I'll run the benchmarks on my machine too and see if I get similar results. I think it is worth us spending time trying to get parsing performance closer to what it was before, if possible. Looking at the numbers here I think it's likely going to end up being slower but hopefully we can get it less than x10 slower. I think a little performance loss is an acceptable tradeoff to be able to move away from macros and on to Scala 3. Again happy for us to merge this PR and do what we can with performance in future PRs.

Looks like mima is complaining on CI, so I think we'll probably make this a major version bump to signal that there are binary incompatible changes. I'll aim to do this next week and get an early milestone release published whilst we work on the above.

Thanks again for your work on this!

@theon theon mentioned this pull request Aug 31, 2021
@theon theon merged commit abf0d79 into lemonlabsuk:master Aug 31, 2021
@theon
Copy link
Member

theon commented Aug 31, 2021

Thanks again. I have merged this, however still stuck for the meantime on getting a Scala 3 build. Stuck on shapeless which will unfortunately likely take some time to resolve before being able to get a Scala 3 milestone published: #343

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants