special case for integer log10#86930
Conversation
|
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
|
Some timings of old versus new: Benchmark details
|
This comment has been minimized.
This comment has been minimized.
|
@bors rollup=never |
|
@bors r+ |
|
📌 Commit ed76c11 has been approved by |
|
⌛ Testing commit ed76c11 with merge c014ff7e6d366543042d6b70e40d023cf27dbdf7... |
|
💔 Test failed - checks-actions |
|
The failure seems spurious, or am I missing something? |
| 1 | ||
| } else { | ||
| 0 | ||
| } |
There was a problem hiding this comment.
Have you tried doing a binary search instead a linear chain of inequalities? I'm not sure if it would actually be faster due to unpredictable branches.
There was a problem hiding this comment.
I did try it and it seemed to be slightly slower (just over the error thresholds), so I thought it better to leave the simpler code since there was no clear gain.
|
@bors retry |
|
⌛ Testing commit ed76c11 with merge 8879bfb0f219936a8255549ba640b7f2f40b793d... |
|
💥 Test timed out |
|
@bors retry |
|
⌛ Testing commit ed76c11 with merge 3f75f8508a00f5046784fa6cec436c926ab6a1b8... |
|
💔 Test failed - checks-actions |
|
@bors retry |
|
☀️ Test successful - checks-actions |
Now that #80918 has been merged, this PR provides a faster version of
log10.The PR also adds some tests for values close to all powers of 10.