Skip to content

Sort out happy flows for fastest execution for expected types #786

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

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

danielgindi
Copy link
Contributor

  • double for GetDouble
  • float for GetFloat
  • decimal for GetDecimal

I set up a fiddle https://dotnetfiddle.net/ZIoKbK to demonstrate the performance differences.
This shows that for the "happy flow" the current implementation is slower by almost 100% than the suggested one.

In int types this is already sorted out.

This avoids the use of the ternary operator, which results in perceived more lines of code, but clearer execution path and more consistent with the implementation of GetInt__.

* double for GetDouble
* float for GetFloat
* decimal for GetDecimal

Signed-off-by: Daniel Cohen Gindi <[email protected]>
@bgrainger bgrainger merged commit ca3bdf5 into mysql-net:master Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants