lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 29b2ad4 14/14: Measure i7702 speed


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 29b2ad4 14/14: Measure i7702 speed
Date: Thu, 1 Apr 2021 18:15:18 -0400 (EDT)

branch: master
commit 29b2ad46d009b35724f66198ab4506fd1a1823df
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Measure i7702 speed
    
    Speed tests use input with length 99, instead of the artificially lower
    lengths that suffice for other tests.
    
    The numerous vector assertions are demonstrably affordable.
---
 i7702_test.cpp | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 objects.make   |  1 +
 2 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/i7702_test.cpp b/i7702_test.cpp
index fa27d10..2af80dd 100644
--- a/i7702_test.cpp
+++ b/i7702_test.cpp
@@ -25,6 +25,7 @@
 
 #include "materially_equal.hpp"
 #include "test_tools.hpp"
+#include "timer.hpp"
 
 class i7702_test
 {
@@ -33,17 +34,24 @@ class i7702_test
         {
         test0();
         test1();
+        assay_speed();
         }
 
   private:
     static i7702 bland0();
     static i7702 bland1();
+    static i7702 bland99();
 
     static void test0();
     static void test1();
+    static void assay_speed();
+
+    static void mete_construct();
+    static void mete_initialize();
+    static void mete_assert();
 };
 
-/// Bland initial values, not varying by duration; Em rounded down.
+/// Bland initial values: a single duration; Em rounded down.
 
 i7702 i7702_test::bland0()
 {
@@ -71,7 +79,7 @@ i7702 i7702_test::bland0()
         };
 }
 
-/// Bland initial values, varying by duration; Em rounded up.
+/// Bland initial values: two durations; Em rounded up.
 
 i7702 i7702_test::bland1()
 {
@@ -99,6 +107,35 @@ i7702 i7702_test::bland1()
         };
 }
 
+/// Bland initial values: ninety-nine durations; Em rounded up.
+
+i7702 i7702_test::bland99()
+{
+    constexpr int length {99};
+    return i7702
+        (length                // length
+        ,0.04                  // A0
+        ,0.06                  // A1
+        ,std::vector<double>(length, 0.03     ) // Bgen
+        ,std::vector<double>(length, 0.00     ) // Bsep
+        ,std::vector<double>(length, 0.02     ) // Bflr
+        ,std::vector<double>(length, 0.02     ) // Bvlr
+        ,std::vector<double>(length, 0.00     ) // Cgen
+        ,std::vector<double>(length, 0.00     ) // Csep
+        ,std::vector<double>(length, 0.00     ) // Cflr
+        ,std::vector<double>(length, 0.00     ) // Cvlr
+        ,std::vector<double>(length, 0.00     ) // Dgen
+        ,std::vector<double>(length, 0.00     ) // Dsep
+        ,std::vector<double>(length, 0.00     ) // Dflr
+        ,std::vector<double>(length, 0.00     ) // Dvlr
+        ,std::vector<double>(length, 0.0032738) // Em
+        ,std::vector<double>(length, 1.0      ) // use_gen
+        ,std::vector<double>(length, 1.0      ) // use_sep
+        ,std::vector<double>(length, 1.0      ) // use_flr
+        ,std::vector<double>(length, 1.0      ) // use_vlr
+        );
+}
+
 void i7702_test::test0()
 {
     i7702 z {bland0()};
@@ -127,6 +164,34 @@ void i7702_test::test1()
     LMI_TEST(materially_equal(0.0032738                , z.ig_usual()[1]));
 }
 
+void i7702_test::assay_speed()
+{
+    std::cout
+        << "\n  Speed tests..."
+        << "\n  Construct : " << TimeAnAliquot(mete_construct)
+        << "\n  Initialize: " << TimeAnAliquot(mete_initialize)
+        << "\n  Assert    : " << TimeAnAliquot(mete_assert)
+        << std::endl
+        ;
+}
+
+void i7702_test::mete_construct()
+{
+    i7702 z {bland99()};
+}
+
+void i7702_test::mete_initialize()
+{
+    static i7702 z {bland99()};
+    z.initialize();
+}
+
+void i7702_test::mete_assert()
+{
+    static i7702 z {bland99()};
+    z.assert_preconditions();
+}
+
 int test_main(int, char*[])
 {
     i7702_test::test();
diff --git a/objects.make b/objects.make
index 7739cf6..9bc6b81 100644
--- a/objects.make
+++ b/objects.make
@@ -690,6 +690,7 @@ i7702_test$(EXEEXT): \
   $(common_test_objects) \
   i7702.o \
   i7702_test.o \
+  timer.o \
 
 ieee754_test$(EXEEXT): \
   $(common_test_objects) \



reply via email to

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