[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/004 4a58266 09/11: Suppress the costly asser
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/004 4a58266 09/11: Suppress the costly assertion that was recently added |
Date: |
Sun, 20 Dec 2020 17:40:10 -0500 (EST) |
branch: valyuta/004
commit 4a5826674d95129670fa59e0cf66df00b317fccc
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Suppress the costly assertion that was recently added
The suppressed assertion
LMI_ASSERT(cents_per_dollar * d == round(cents_per_dollar * d));
detected currency amounts constructed from unrounded doubles, e.g.
currency c0(3.14); // 314 != 100.0 * double(3.14)
as opposed to
currency c1 = round_to<whatever>.c(3.14); // exactly 314
The full nychthemeral test suite has been run for all architectures
without that assertion firing; that doesn't prove that it never could,
but it does strongly suggest that any remaining violations of that
hoped-for invariant are likely to be of little consequence.
---
Speed_gcc_i686-w64-mingw32 | 12 ++++++------
Speed_gcc_x86_64-pc-linux-gnu | 12 ++++++------
Speed_gcc_x86_64-w64-mingw32 | 12 ++++++------
currency.hpp | 2 +-
4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Speed_gcc_i686-w64-mingw32 b/Speed_gcc_i686-w64-mingw32
index 9971b0f..ff22050 100644
--- a/Speed_gcc_i686-w64-mingw32
+++ b/Speed_gcc_i686-w64-mingw32
@@ -1,7 +1,7 @@
Test speed:
- naic, no solve : 6.594e-02 s mean; 65604 us least of 16 runs
- naic, specamt solve : 1.163e-01 s mean; 115862 us least of 9 runs
- naic, ee prem solve : 1.063e-01 s mean; 106045 us least of 10 runs
- finra, no solve : 2.386e-02 s mean; 23704 us least of 42 runs
- finra, specamt solve: 6.942e-02 s mean; 69231 us least of 15 runs
- finra, ee prem solve: 6.444e-02 s mean; 64223 us least of 16 runs
+ naic, no solve : 6.524e-02 s mean; 64858 us least of 16 runs
+ naic, specamt solve : 1.150e-01 s mean; 114279 us least of 9 runs
+ naic, ee prem solve : 1.053e-01 s mean; 104677 us least of 10 runs
+ finra, no solve : 2.393e-02 s mean; 23645 us least of 42 runs
+ finra, specamt solve: 6.902e-02 s mean; 68719 us least of 15 runs
+ finra, ee prem solve: 6.406e-02 s mean; 63602 us least of 16 runs
diff --git a/Speed_gcc_x86_64-pc-linux-gnu b/Speed_gcc_x86_64-pc-linux-gnu
index dc0bcf6..b6862c6 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.692e-02 s mean; 25779 us least of 38 runs
- naic, specamt solve : 4.551e-02 s mean; 44600 us least of 22 runs
- naic, ee prem solve : 4.443e-02 s mean; 40609 us least of 23 runs
- finra, no solve : 8.529e-03 s mean; 8269 us least of 100 runs
- finra, specamt solve: 2.583e-02 s mean; 25023 us least of 39 runs
- finra, ee prem solve: 2.523e-02 s mean; 23776 us least of 40 runs
+ naic, no solve : 2.684e-02 s mean; 25770 us least of 38 runs
+ naic, specamt solve : 4.508e-02 s mean; 44635 us least of 23 runs
+ naic, ee prem solve : 4.130e-02 s mean; 40678 us least of 25 runs
+ finra, no solve : 8.551e-03 s mean; 8204 us least of 100 runs
+ finra, specamt solve: 2.566e-02 s mean; 25343 us least of 39 runs
+ finra, ee prem solve: 2.386e-02 s mean; 23252 us least of 42 runs
diff --git a/Speed_gcc_x86_64-w64-mingw32 b/Speed_gcc_x86_64-w64-mingw32
index d0a2a4b..1abfad6 100644
--- a/Speed_gcc_x86_64-w64-mingw32
+++ b/Speed_gcc_x86_64-w64-mingw32
@@ -1,7 +1,7 @@
Test speed:
- naic, no solve : 3.510e-02 s mean; 34921 us least of 29 runs
- naic, specamt solve : 5.626e-02 s mean; 55968 us least of 18 runs
- naic, ee prem solve : 5.199e-02 s mean; 51731 us least of 20 runs
- finra, no solve : 1.593e-02 s mean; 15823 us least of 63 runs
- finra, specamt solve: 3.603e-02 s mean; 34815 us least of 28 runs
- finra, ee prem solve: 3.359e-02 s mean; 32930 us least of 31 runs
+ naic, no solve : 3.537e-02 s mean; 34134 us least of 29 runs
+ naic, specamt solve : 5.468e-02 s mean; 54289 us least of 19 runs
+ naic, ee prem solve : 5.064e-02 s mean; 50482 us least of 20 runs
+ finra, no solve : 1.590e-02 s mean; 15745 us least of 63 runs
+ finra, specamt solve: 3.433e-02 s mean; 34157 us least of 30 runs
+ finra, ee prem solve: 3.237e-02 s mean; 32215 us least of 31 runs
diff --git a/currency.hpp b/currency.hpp
index c541f64..a745946 100644
--- a/currency.hpp
+++ b/currency.hpp
@@ -148,7 +148,7 @@ class currency
// data_type from_double(double d) const {return cents_per_dollar * d ;}
data_type from_double(double d) const
{
- LMI_ASSERT(cents_per_dollar * d == round(cents_per_dollar * d));
+// LMI_ASSERT(cents_per_dollar * d == round(cents_per_dollar * d));
return cents_per_dollar * d;
}
// Here, bourn_cast costs something, but does nothing:
- [lmi-commits] [lmi] valyuta/004 updated (3742c54 -> b73e751), Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 be42a58 03/11: Assert rather than assign, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 4a58266 09/11: Suppress the costly assertion that was recently added,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/004 2913536 06/11: Fix a unit test, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 c5f666f 08/11: Improve rounding to cents for solves, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 34326d6 04/11: Eliminate a return code that was always zero, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 abb1363 05/11: Refactor a unit test, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 7eacf2b 07/11: Prefer explicit to implicit currency rounding in unit test, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 58962eb 01/11: Refactor, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 9a03ce9 10/11: Add a handy git command, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 b73e751 11/11: Record timings as of 20201215T2247Z SHA1 3742c540, Greg Chicares, 2020/12/20
- [lmi-commits] [lmi] valyuta/004 0c93fc2 02/11: Fix a problem somewhat mystically, Greg Chicares, 2020/12/20