mpn_sqr speed

Win C winsto003 at hotmail.com
Fri Feb 9 08:24:18 UTC 2018


This is the result of the speed program for comparison of squaring methods, run on an ARM CPU.

./speed -s 1,2,4,8,16,32,64,128,256,1024,2048,4096,8192,16384,32768,65536 mpn_sqr mpn_mul_fft_sqr
WARNING: linker: ./speed has text relocations. This is wasting memory and prevents security hardening. Please fix.
overhead 0.000000007 secs, precision 10000 units of 1.00e-09 secs, CPU freq 1600.00 MHz
              mpn_sqr mpn_mul_fft_sqr
1        #0.000000041   0.000041769
2        #0.000000047   0.000042115
4        #0.000000087   0.000042461
8        #0.000000242   0.000042769
16       #0.000000673   0.000043115
32       #0.000002200   0.000044807
64       #0.000007097   0.000053230
128      #0.000021769   0.000065808
256      #0.000063269   0.000093308
1024      0.000452731  #0.000352000
2048      0.001192230  #0.000786615
4096      0.002319538  #0.001268731
8192      0.005638807  #0.002916500
16384     0.012794616  #0.006857692
32768     0.029267846  #0.015556808
65536     0.068601077  #0.038244577

As shown the results above, using a specific function to do squaring is even faster than than the external function of mpn_sqr(). Why is it so? And how to change the mpn/generic/sqr.c file to fix this? Thanks!


More information about the gmp-discuss mailing list