Re: [sage-devel] Re: devising a speed comparison test between different types

2016-12-04 Thread William Stein
On Sat, Dec 3, 2016 at 10:53 PM, Ralf Stephan <> wrote: “Both ZZ and numpy use libgmp internally “ No, ZZ uses libgmp (actually really MPIR, which is a fork of GMP), and numpy uses Python’s ints/longs. Python’s int/long type is arbitrary precision, despite the confusing naming. It only implements

Re: [sage-devel] Re: devising a speed comparison test between different types

2016-12-04 Thread Volker Braun
On Sunday, December 4, 2016 at 5:58:45 PM UTC+1, Pierre wrote: > -- numpy.int32 or int.64: like "int" initially, but works mod 2^32 or > 2^64, and gives an overflow warning when it happens. No increase in > speed, for general reasons which I will just call "overhead" for lack > of a better unde

Re: [sage-devel] Re: devising a speed comparison test between different types

2016-12-04 Thread Pierre Guillot
PPS come to think of it, my last PS explains it all. So in summary: -- ZZ= always arbitrary precision. -- int= a C int when the numbers stay < 2^64, so there is an increase of speed -- but not nearly as much of an increase as I expected, which is why I was confused at first, because I wasn't seein