lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] valyuta/005 b0912f5 5/6: Cache all product files, fo


From: Greg Chicares
Subject: [lmi-commits] [lmi] valyuta/005 b0912f5 5/6: Cache all product files, for illustrations at least
Date: Mon, 25 Jan 2021 12:11:02 -0500 (EST)

branch: valyuta/005
commit b0912f545ee78bd1438ddea54453615f66071336
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Cache all product files, for illustrations at least
    
    For certain other uses, declare an intention to cache later, with a
    comment marker that will be flagged for action even though it is not
    pedantically correct.
    
    Overall, this improves speed by one or two percent for scenarios with
    solves, and seven percent without. Although all minimum times improved,
    mean times for i686 worsened in half the scenarios--evidently a random
    artifact: repeating 'make cli_timing' (results not committed) made all
    i686 timings better except for the mean in a single scenario that shows
    an improvement in the committed results.
    
    The minimum seems better behaved than the mean, but probably some more
    robust statistic should be collected--Tukey's trimean, perhaps?
---
 Speed_gcc_i686-w64-mingw32    | 12 ++++++------
 Speed_gcc_x86_64-pc-linux-gnu | 12 ++++++------
 Speed_gcc_x86_64-w64-mingw32  | 12 ++++++------
 gpt_server.cpp                |  3 +++
 ihs_basicval.cpp              | 15 +++++++++------
 mec_server.cpp                |  3 +++
 verify_products.cpp           |  2 ++
 7 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/Speed_gcc_i686-w64-mingw32 b/Speed_gcc_i686-w64-mingw32
index f694865..6d9aad9 100644
--- a/Speed_gcc_i686-w64-mingw32
+++ b/Speed_gcc_i686-w64-mingw32
@@ -1,7 +1,7 @@
 Test speed:
-  naic, no solve      : 5.403e-02 s mean;      53393 us least of  19 runs
-  naic, specamt solve : 1.006e-01 s mean;      99589 us least of  10 runs
-  naic, ee prem solve : 9.149e-02 s mean;      90717 us least of  11 runs
-  finra, no solve     : 1.678e-02 s mean;      16498 us least of  60 runs
-  finra, specamt solve: 5.912e-02 s mean;      58613 us least of  17 runs
-  finra, ee prem solve: 5.441e-02 s mean;      53814 us least of  19 runs
+  naic, no solve      : 5.262e-02 s mean;      52492 us least of  20 runs
+  naic, specamt solve : 1.034e-01 s mean;      98714 us least of  10 runs
+  naic, ee prem solve : 9.011e-02 s mean;      89884 us least of  12 runs
+  finra, no solve     : 1.551e-02 s mean;      15354 us least of  65 runs
+  finra, specamt solve: 6.572e-02 s mean;      58341 us least of  16 runs
+  finra, ee prem solve: 5.802e-02 s mean;      53904 us least of  18 runs
diff --git a/Speed_gcc_x86_64-pc-linux-gnu b/Speed_gcc_x86_64-pc-linux-gnu
index 7b3753f..37ffb11 100644
--- a/Speed_gcc_x86_64-pc-linux-gnu
+++ b/Speed_gcc_x86_64-pc-linux-gnu
@@ -1,7 +1,7 @@
 Test speed:
-  naic, no solve      : 2.044e-02 s mean;      20220 us least of  49 runs
-  naic, specamt solve : 3.726e-02 s mean;      36783 us least of  27 runs
-  naic, ee prem solve : 3.398e-02 s mean;      33615 us least of  30 runs
-  finra, no solve     : 6.002e-03 s mean;       5817 us least of 100 runs
-  finra, specamt solve: 2.112e-02 s mean;      20787 us least of  48 runs
-  finra, ee prem solve: 1.938e-02 s mean;      19053 us least of  52 runs
+  naic, no solve      : 2.033e-02 s mean;      19830 us least of  50 runs
+  naic, specamt solve : 3.659e-02 s mean;      36152 us least of  28 runs
+  naic, ee prem solve : 3.337e-02 s mean;      32977 us least of  30 runs
+  finra, no solve     : 5.634e-03 s mean;       5422 us least of 100 runs
+  finra, specamt solve: 2.064e-02 s mean;      20211 us least of  49 runs
+  finra, ee prem solve: 1.902e-02 s mean;      18790 us least of  53 runs
diff --git a/Speed_gcc_x86_64-w64-mingw32 b/Speed_gcc_x86_64-w64-mingw32
index c000bc9..e66c330 100644
--- a/Speed_gcc_x86_64-w64-mingw32
+++ b/Speed_gcc_x86_64-w64-mingw32
@@ -1,7 +1,7 @@
 Test speed:
-  naic, no solve      : 2.892e-02 s mean;      27326 us least of  35 runs
-  naic, specamt solve : 4.745e-02 s mean;      46904 us least of  22 runs
-  naic, ee prem solve : 4.356e-02 s mean;      43001 us least of  23 runs
-  finra, no solve     : 1.052e-02 s mean;      10261 us least of  96 runs
-  finra, specamt solve: 2.847e-02 s mean;      28027 us least of  36 runs
-  finra, ee prem solve: 2.655e-02 s mean;      26090 us least of  38 runs
+  naic, no solve      : 2.694e-02 s mean;      26676 us least of  38 runs
+  naic, specamt solve : 4.656e-02 s mean;      46137 us least of  22 runs
+  naic, ee prem solve : 4.271e-02 s mean;      42282 us least of  24 runs
+  finra, no solve     : 9.687e-03 s mean;       9473 us least of 100 runs
+  finra, specamt solve: 2.739e-02 s mean;      27091 us least of  37 runs
+  finra, ee prem solve: 2.633e-02 s mean;      25163 us least of  38 runs
diff --git a/gpt_server.cpp b/gpt_server.cpp
index 220cfd0..6abc2a7 100644
--- a/gpt_server.cpp
+++ b/gpt_server.cpp
@@ -123,8 +123,10 @@ gpt_state test_one_days_gpt_transactions
     double                      Payment                      = 
exact_cast<tnr_nonnegative_double  >(input["Payment"                     
])->value();
     double                      BenefitAmount                = 
exact_cast<tnr_nonnegative_double  >(input["BenefitAmount"               
])->value();
 
+    // CURRENCY !! [not really currency] consider caching this
     product_data product_filenames(ProductName);
 
+    // CURRENCY !! [not really currency] consider caching this
     product_database database
         (ProductName
         ,NewGender
@@ -135,6 +137,7 @@ gpt_state test_one_days_gpt_transactions
         ,StateOfJurisdiction
         );
 
+    // CURRENCY !! [not really currency] consider caching this
     stratified_charges 
stratified(AddDataDir(product_filenames.datum("TierFilename")));
 
     // SOMEDAY !! Ideally these would be in the GUI (or read from product 
files).
diff --git a/ihs_basicval.cpp b/ihs_basicval.cpp
index e256df6..b63d368 100644
--- a/ihs_basicval.cpp
+++ b/ihs_basicval.cpp
@@ -175,14 +175,17 @@ BasicValues::BasicValues
 //============================================================================
 void BasicValues::Init()
 {
-    lingo_ = 
lingo::read_via_cache(AddDataDir(product().datum("LingoFilename")));
-    FundData_.reset(new FundData(AddDataDir(product().datum("FundFilename"))));
-    RoundingRules_.reset
-        (new rounding_rules(AddDataDir(product().datum("RoundingFilename")))
+    // This wants to be refactored:
+    lingo_             = lingo::read_via_cache
+        (AddDataDir(product().datum("LingoFilename")));
+    FundData_          = FundData::read_via_cache
+        (AddDataDir(product().datum("FundFilename")));
+    RoundingRules_     = rounding_rules::read_via_cache
+        (AddDataDir(product().datum("RoundingFilename"))
         );
     SetRoundingFunctors();
-    StratifiedCharges_.reset
-        (new stratified_charges(AddDataDir(product().datum("TierFilename")))
+    StratifiedCharges_ = stratified_charges::read_via_cache
+        (AddDataDir(product().datum("TierFilename"))
         );
 
     SetPermanentInvariants();
diff --git a/mec_server.cpp b/mec_server.cpp
index b017732..c1c75f2 100644
--- a/mec_server.cpp
+++ b/mec_server.cpp
@@ -106,8 +106,10 @@ mec_state test_one_days_7702A_transactions
     double                      Payment                      = 
exact_cast<tnr_nonnegative_double  >(input["Payment"                     
])->value();
     double                      BenefitAmount                = 
exact_cast<tnr_nonnegative_double  >(input["BenefitAmount"               
])->value();
 
+    // CURRENCY !! [not really currency] consider caching this
     product_data product_filenames(ProductName);
 
+    // CURRENCY !! [not really currency] consider caching this
     product_database database
         (ProductName
         ,Gender
@@ -118,6 +120,7 @@ mec_state test_one_days_7702A_transactions
         ,StateOfJurisdiction
         );
 
+    // CURRENCY !! [not really currency] consider caching this
     stratified_charges 
stratified(AddDataDir(product_filenames.datum("TierFilename")));
 
     // SOMEDAY !! Ideally these would be in the GUI (or read from product 
files).
diff --git a/verify_products.cpp b/verify_products.cpp
index 5c2fbc0..fea1d66 100644
--- a/verify_products.cpp
+++ b/verify_products.cpp
@@ -80,6 +80,7 @@ product_verifier::product_verifier
     ,p_            
(*product_data::read_via_cache(filename_from_product_name(product_name)))
     ,gender_       {mce_gender (gender_str ).value()}
     ,smoking_      {mce_smoking(smoking_str).value()}
+    // CURRENCY !! [not really currency] consider caching this
     ,db0_
         (product_name
         ,gender_
@@ -90,6 +91,7 @@ product_verifier::product_verifier
         ,mce_s_XX
         )
     ,min_age_      {db0_.query<int>(DB_MinIssAge)}
+    // CURRENCY !! [not really currency] consider caching this
     ,db_
         (product_name
         ,gender_



reply via email to

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