Skip to content

Dev Notes: 2017_01_20

Dave Hudson edited this page Jan 20, 2017 · 17 revisions

Starting To Understand Performance

I realized that the test apps were being built with dynamic linking so switched the builds to use static linking. Dynamically linked libraries use small stubs in a procedure linkage table (PLT) that sit between callers and the actual code in the dynamic library; using static linking avoids this.

With these changes we can look at the performance profile for the rational number unit test:

cons 0     |      15456 | pass | 0/1
cons 1     |      19108 | pass | 8/3
cons 2     |      10552 | pass | -101/3
cons 3     |      40008 | pass | -19999837590318351965518515651585519655196/5
cons 4     |      52480 | pass | 2/5154875894574578457805710875418754097512875120572105234652346059
cons 5     |      34560 | pass | 0x1/0x1000000000000000000000000000000000000000000000000000000000000000
cons 6     |    5494894 | pass | exception thrown: invalid digit
cons 7     |      15924 | pass | 9/8
cons 8     |       7672 | pass | -1/1048576
cons 9     |      18932 | pass | exception thrown: not a number
cons 10    |      17532 | pass | ccccccccccccd/80000000000000
add 0      |       9892 | pass | 73/3
add 1      |      15800 | pass | 71/26
add 2      |      28336 | pass | -34738957485741895748957485743809574800000000/287923
add 3      |      28312 | pass | -192222213333333333333333333333333333333333333333333333333333334333416153/31
sub 0      |      11568 | pass | 101/6
sub 1      |      32384 | pass | -5872488729698595999749602411500766185722239445613509099777952305512191704320129156897500143/3
sub 2      |      28844 | pass | 1020000000000000000000000000000000000000000000000000000000000000000000000/707
sub 3      |      15032 | pass | -50/31459
comp 0a    |       1592 | pass | 0
comp 0b    |        956 | pass | 1
comp 0c    |        916 | pass | 1
comp 0d    |        948 | pass | 1
comp 0e    |        928 | pass | 0
comp 0f    |        916 | pass | 0
comp 1a    |       1024 | pass | 0
comp 1b    |        996 | pass | 1
comp 1c    |       1004 | pass | 0
comp 1d    |       1000 | pass | 0
comp 1e    |        936 | pass | 1
comp 1f    |        976 | pass | 1
comp 2a    |       1040 | pass | 0
comp 2b    |       1000 | pass | 1
comp 2c    |       1020 | pass | 1
comp 2d    |        952 | pass | 1
comp 2e    |        932 | pass | 0
comp 2f    |        936 | pass | 0
comp 3a    |       1132 | pass | 1
comp 3b    |       1036 | pass | 0
comp 3c    |       1012 | pass | 0
comp 3d    |       1004 | pass | 1
comp 3e    |        972 | pass | 0
comp 3f    |        992 | pass | 1
mul 0      |       6100 | pass | 1/1250
mul 1      |      15704 | pass | -1111111111111111111000000000000000000/777
mul 2      |       7836 | pass | -4000000000000000000000000000000/1
mul 3      |      67560 | pass | 15241578753238836750495351562566681945008382873376009755225118122311263526910001371743100137174310012193273126047859425087639153757049236500533455762536198787501905199875019052100/169
div 0      |      17488 | pass | 1000000000000000000/99999999999999999
div 1      |      93808 | pass | -7829238792751875818917817519758789749174743847389742871867617465710657162/99999999999999999
div 2      |     105804 | pass | -17000000000000000000000000000000000000000000000000000000000000000/1150a3242000000008a851921
div 3      |      24868 | pass | exception thrown: divide by zero
div 4      |      91347 | pass | 28279753000000000000000000/2392375827899999976076241721
todouble 0 |        382 | pass | 0
todouble 1 |       4014 | pass | -50.8475
todouble 2 |       4305 | pass | 1.23038e+50
todouble 3 |       3723 | pass | 0.1
todouble 4 |      23844 | pass | exception thrown: overflow error
toparts 0  |        990 | pass | 0,1
toparts 1  |        227 | pass | -1500,29
prn 0      |      56527 | pass | -4701397401952099592073/65689
prn 1      |      45775 | pass | -fedcfedc0123456789/10099
prn 2      |      45366 | pass | -FEDCFEDC0123456789/10099
prn 3      |      61155 | pass | -775563766700044321263611/200231
prn 4      |      55870 | pass | -4701397401952099592073/65689
prn 5      |      81993 | pass | -0xfedcfedc0123456789/0x10099
prn 6      |      45914 | pass | -0XFEDCFEDC0123456789/0X10099
prn 7      |      61091 | pass | -0775563766700044321263611/0200231

We can somewhat dismiss

See Also

Clone this wiki locally