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 math.Sqrt for IntegerSquareRoot #5253

Merged
merged 2 commits into from
Mar 31, 2020
Merged

Use math.Sqrt for IntegerSquareRoot #5253

merged 2 commits into from
Mar 31, 2020

Conversation

prestonvanloon
Copy link
Member

Go's standard library uses assembly level sqrt which is optimized for the given processor architecture.

Some results:

BenchmarkIntegerSquareRoot                                                                                                                                                                                        
BenchmarkIntegerSquareRoot/Go                                                                                                                                                                                     
BenchmarkIntegerSquareRoot/Go-8                 40517990                61.4 ns/op
BenchmarkIntegerSquareRoot/STD
BenchmarkIntegerSquareRoot/STD-8                322246521                3.69 ns/op

@prestonvanloon prestonvanloon added the Ready For Review A pull request ready for code review label Mar 30, 2020
@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@7f7866f). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master    #5253   +/-   ##
=========================================
  Coverage          ?   54.58%           
=========================================
  Files             ?      288           
  Lines             ?    22733           
  Branches          ?        0           
=========================================
  Hits              ?    12408           
  Misses            ?     8567           
  Partials          ?     1758

@prylabs-bulldozer prylabs-bulldozer bot merged commit 17516b6 into master Mar 31, 2020
@delete-merged-branch delete-merged-branch bot deleted the faster-sqrt branch March 31, 2020 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants