-
-
Notifications
You must be signed in to change notification settings - Fork 1k
refactor: use stdlib_base_fmod instead of built-in in math/base/special/gcd
#2815
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
Conversation
This reverts commit a0c1fc4.
|
As discussed, I generated benchmark results before and after making the changes proposed in this PR. Before:
TAP version 13
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.202160416
rate: 49465667.89811117
...
ok 1 benchmark finished
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.200456208
rate: 49886207.565095715
...
ok 2 benchmark finished
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.200792958
rate: 49802543.37405598
...
ok 3 benchmark finished
#
1..3
# total 3
# pass 3
#
# ok
TAP version 13
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.446446833
rate: 22399083.74487226
...
ok 1 benchmark finished
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.442721583
rate: 22587559.278762337
...
ok 2 benchmark finished
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.452107708
rate: 22118623.113587793
...
ok 3 benchmark finished
#
1..3
# total 3
# pass 3
#
# okAfter:
TAP version 13
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.205398375
rate: 48685876.89654312
...
ok 1 benchmark finished
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.202361708
rate: 49416463.711602986
...
ok 2 benchmark finished
# @stdlib/math/base/special/gcd
---
iterations: 10000000
elapsed: 0.207460667
rate: 48201908.075423285
...
ok 3 benchmark finished
#
1..3
# total 3
# pass 3
#
# ok
TAP version 13
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.435659958
rate: 22953681.687679913
...
ok 1 benchmark finished
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.433399375
rate: 23073406.601013213
...
ok 2 benchmark finished
# @stdlib/math/base/special/gcd::native
---
iterations: 10000000
elapsed: 0.438695959
rate: 22794830.43973058
...
ok 3 benchmark finished
#
1..3
# total 3
# pass 3
#
# ok |
|
Looks like while the |
|
@gunjjoshi Yes, I think only using |
Signed-off-by: Gunj Joshi <gunjjoshi8372@gmail.com>
Planeshifter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
This pull request:
fmodby ourstdlib_base_fmodinmath/base/special/gcd.Related Issues
None.
Questions
No.
Other
I've changed the
jsimplementation as well, to use ourfmodinstead of its%operator, so that both the implementations are close enough.Checklist
@stdlib-js/reviewers