lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Speed comparison: production vs. valyuta


From: Greg Chicares
Subject: [lmi] Speed comparison: production vs. valyuta
Date: Fri, 22 Jan 2021 08:25:11 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

'valyuta/005' is the latest branch that uses a new currency class,
which treats currency amounts as integral numbers of cents. Here's
a performance comparison for the six 'make cli_timing' scenarios:
 -  naic, no solve
 -  naic, specamt solve
 -  naic, ee prem solve
 -  finra, no solve
 -  finra, specamt solve
 -  finra, ee prem solve
  (naic solves for guaranteed premium in addition to any input solve)
showing mean (s) and lowest (usec) clock time for each of
 - production (branch 'master')
 - valyuta/005 with #undef USE_CURRENCY_CLASS
 - valyuta/005 with #undef CURRENCY_UNIT_IS_CENTS
 - valyuta/005 HEAD
and for each of
 - i686-w64-mingw32
 - x86_64-pc-linux-gnu
 - x86_64-w64-mingw32
along with relative error
  (observed - expected) / expected - 1
all of which I hope comes through tab-delimited:

        production              no class                no cents                
valyuta
        dfdbf3c5a               86cba7f81               6767160d9               
4b0bf87fa
                                                        
0.05244 52015   0.04877 48452   0.04831 48156   0.05379 53446   
Speed_gcc_i686-w64-mingw32
0.09343 92665   0.09172 91198   0.09056 90364   0.1001  99577
0.08574 85253   0.08385 83264   0.0827  82552   0.09113 90771
0.02275 21555   0.01603 15850   0.01618 15743   0.01657 16402
0.05958 58773   0.05544 55009   0.05652 54358   0.05885 58558
0.0556  54771   0.05117 50668   0.05036 50200   0.05412 53919
                                                        
0.01981 18713   0.01688 16604   0.01734 16554   0.02039 20072   
Speed_gcc_x86_64-pc-linux-gnu
0.03313 32640   0.03098 30560   0.03106 30265   0.03704 36518
0.03044 29950   0.02835 27963   0.02827 27783   0.03374 33142
0.007627        7194    0.005505        5368    0.005503        5201    
0.005961        5834
0.02051 20047   0.0185  17950   0.01845 18055   0.02107 20472
0.01918 18550   0.01715 16793   0.017   16579   0.01947 19032
                                                        
0.02679 26410   0.02581 24554   0.02483 24523   0.0278  27428   
Speed_gcc_x86_64-w64-mingw32
0.04213 41548   0.04269 42124   0.04254 42068   0.0475  46912
0.03923 38721   0.03927 38772   0.03906 38668   0.04361 43042
0.01468 14383   0.01022 9941    0.01013 9900    0.01057 10328
0.02881 28406   0.02638 25978   0.02728 26028   0.02841 28041
0.02739 26940   0.02462 24272   0.02456 24206   0.02641 26042
                                                        
rel err vs production--higher is better than production                         
                        
                                                        
0%      0%      7%      7%      8%      7%      -3%     -3%
0%      0%      2%      2%      3%      2%      -7%     -7%
0%      0%      2%      2%      4%      3%      -6%     -6%
0%      0%      30%     26%     29%     27%     27%     24%
0%      0%      7%      6%      5%      8%      1%      0%
0%      0%      8%      7%      9%      8%      3%      2%
                                                        
0%      0%      15%     11%     12%     12%     -3%     -7%
0%      0%      6%      6%      6%      7%      -12%    -12%
0%      0%      7%      7%      7%      7%      -11%    -11%
0%      0%      28%     25%     28%     28%     22%     19%
0%      0%      10%     10%     10%     10%     -3%     -2%
0%      0%      11%     9%      11%     11%     -2%     -3%
                                                        
0%      0%      4%      7%      7%      7%      -4%     -4%
0%      0%      -1%     -1%     -1%     -1%     -13%    -13%
0%      0%      0%      0%      0%      0%      -11%    -11%
0%      0%      30%     31%     31%     31%     28%     28%
0%      0%      8%      9%      5%      8%      1%      1%
0%      0%      10%     10%     10%     10%     4%      3%
                                                        
rel err vs valyuta--higher is better than valyuta HEAD                          
                        
                                                        
3%      3%      9%      9%      10%     10%     0%      0%
7%      7%      8%      8%      10%     9%      0%      0%
6%      6%      8%      8%      9%      9%      0%      0%
-37%    -31%    3%      3%      2%      4%      0%      0%
-1%     0%      6%      6%      4%      7%      0%      0%
-3%     -2%     5%      6%      7%      7%      0%      0%
                                                        
3%      7%      17%     17%     15%     18%     0%      0%
11%     11%     16%     16%     16%     17%     0%      0%
10%     10%     16%     16%     16%     16%     0%      0%
-28%    -23%    8%      8%      8%      11%     0%      0%
3%      2%      12%     12%     12%     12%     0%      0%
1%      3%      12%     12%     13%     13%     0%      0%
                                                        
4%      4%      7%      10%     11%     11%     0%      0%
11%     11%     10%     10%     10%     10%     0%      0%
10%     10%     10%     10%     10%     10%     0%      0%
-39%    -39%    3%      4%      4%      4%      0%      0%
-1%     -1%     7%      7%      4%      7%      0%      0%
-4%     -3%     7%      7%      7%      7%      0%      0%

The currency class isn't the only difference: valyuta reworks many
calculations for more careful rounding, which costs something, and
for efficiency, which offsets that cost; and it also caches product
files, which is a significant improvement.

Currency-class operations are of course used most heavily in the
monthiversary loop. A "solve" runs that iteratively (say, ten or
twenty times) to achieve a goal. Only the fourth of six scenarios
involves no solve; there, the differences are dominated by general
improvements like product-file caching. Conversely, the second and
third of six scenarios involve both an input solve and a solve for
guaranteed premium; there, the currency class dominates the timing
differences.

We plan to "merge" valyuta into master, where "merge" doesn't mean
anything quite like git-merge, because valyuta includes many changes
that pay insufficient heed to efficiency and must be extensively
reworked. Great attention has been paid to accuracy, though: out of
twelve hundred full illustrations run in 'make system_test', one
differs by about twenty dollars, three differ by one to four dollars,
and one hundred twenty by more than one cent. Thus, no grave errors
in master have been found. But rounding currency to exact integral
cents will save us the considerable effort we've spent analyzing and
accepting regressions of less than one cent, which will no longer be
possible.

This analysis uses gcc-8.3 (msw) and gcc-10.2.0 (pc-linux-gnu),
using wine-4.0.3 to run the msw builds.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]