Challenge: optimizing isqrt

Serhiy Storchaka storchaka at gmail.com
Wed Nov 26 17:24:59 CET 2014


On 26.11.14 02:46, Dave Angel wrote:
> Unfortunately, for many values, the version of the function with >>1 is
> slower.  It's only when the argument is bigger than 10**40 that it's as
> much as 1% faster.  But it's true that for really large values, it's
> quicker.

Note that this path is used only for values above 2**53 (about 10**16). 
For all tested values from 10**16 to 10**40 the difference between two 
versions is not larger than 1% (in one or other direction). But the 
difference between different runs of the benchmark for the same version 
vary about 1%. So the difference between versions in this range doesn't 
matter.





More information about the Python-list mailing list