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

Improve speed of bool-to-int conversions #796

Merged
merged 3 commits into from Sep 12, 2018

Conversation

jcburley
Copy link
Contributor

@jcburley jcburley commented Sep 10, 2018

Use a simple function that tests the bool and returns 0 for false and
1 for true, rather than a map that does the same thing, as Go appears
to compile the former into much faster code.


This change is Reviewable

James Craig Burley added 2 commits September 10, 2018 02:11
Use a simple function that tests the bool and returns 0 for false and
1 for true, rather than a map that does the same thing, as Go appears
to compile the former into much faster code.
Use a simple function that tests the bool and returns 0 for false and
1 for true, rather than a map that does the same thing, as Go appears
to compile the former into much faster code.
@jcburley
Copy link
Contributor Author

This should fix #795.

@codecov
Copy link

codecov bot commented Sep 11, 2018

Codecov Report

Merging #796 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #796   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files         169      169           
  Lines        9781     9781           
=======================================
  Hits         7859     7859           
  Misses       1473     1473           
  Partials      449      449
Impacted Files Coverage Δ
types/cast.go 69.82% <100%> (ø) ⬆️

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 161a222...ab8f783. Read the comment docs.

@jcburley jcburley changed the title Improve speed of int-to-bool conversions Improve speed of bool-to-int conversions Sep 11, 2018
Copy link
Owner

@elliotchance elliotchance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Owner

@elliotchance elliotchance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@elliotchance elliotchance merged commit bb2dbbb into elliotchance:master Sep 12, 2018
@jcburley jcburley deleted the fast-bool-to-int branch September 12, 2018 15:54
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

2 participants