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

Optimize Not error condition #363

Merged
merged 1 commit into from Jan 29, 2022
Merged

Optimize Not error condition #363

merged 1 commit into from Jan 29, 2022

Conversation

johnynek
Copy link
Collaborator

We use Eval to defer doing any work except allocation on errors since oneOf can recover failures. So we don't actually want to run the error condition until the end.

Not was allocating a copy of a string before the Eval so that allocation had to happen on every failure, which could be a lot for some cases. By moving the allocation inside the Eval we will (almost certainly) save.

@codecov-commenter
Copy link

codecov-commenter commented Jan 28, 2022

Codecov Report

Merging #363 (aa15a7e) into main (828ff4b) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #363      +/-   ##
==========================================
+ Coverage   96.63%   96.72%   +0.09%     
==========================================
  Files           9        9              
  Lines        1128     1130       +2     
  Branches       99       99              
==========================================
+ Hits         1090     1093       +3     
+ Misses         38       37       -1     
Impacted Files Coverage Δ
core/shared/src/main/scala/cats/parse/Parser.scala 96.70% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 828ff4b...aa15a7e. Read the comment docs.

@johnynek johnynek merged commit 2e916ff into main Jan 29, 2022
@johnynek johnynek deleted the oscar/opt_not branch January 29, 2022 19:44
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.

None yet

3 participants