Changeset ee23a8d


Ignore:
Timestamp:
Jul 5, 2021, 3:17:12 PM (3 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
11ad42f, e84ab3d
Parents:
b7763da
Message:

Added duration information (in nanoseconds) to EHM benchmarks.

Location:
doc/theses/andrew_beach_MMath/code
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/CondMatch.java

    rb7763da ree23a8d  
    3030                }
    3131
     32                long startTime = System.nanoTime();
    3233                for (int count = 0 ; count < times ; ++count) {
    3334                        try {
     
    3738                        }
    3839                }
     40                long endTime = System.nanoTime();
     41                System.out.println("Run-Time (ns) " + (endTime - startTime));
    3942        }
    4043}
  • doc/theses/andrew_beach_MMath/code/CrossCatch.java

    rb7763da ree23a8d  
    1111                }
    1212
     13                long startTime = System.nanoTime();
    1314                for (int count = 0 ; count < times ; ++count) {
    1415                        try {
     
    2021                        }
    2122                }
     23                long endTime = System.nanoTime();
     24                System.out.println("Run-Time (ns) " + (endTime - startTime));
    2225        }
    2326}
  • doc/theses/andrew_beach_MMath/code/CrossFinally.java

    rb7763da ree23a8d  
    99                }
    1010
     11                long startTime = System.nanoTime();
    1112                for (int count = 0 ; count < times ; ++count) {
    1213                        try {
     
    1617                        }
    1718                }
     19                long endTime = System.nanoTime();
     20                System.out.println("Run-Time (ns) " + (endTime - startTime));
    1821        }
    1922}
  • doc/theses/andrew_beach_MMath/code/ThrowEmpty.java

    rb7763da ree23a8d  
    2222                }
    2323
     24                long startTime = System.nanoTime();
    2425                for (int count = 0 ; count < times ; ++count) {
    2526                        try {
     
    2930                        }
    3031                }
     32                long endTime = System.nanoTime();
     33                System.out.println("Run-Time (ns) " + (endTime - startTime));
    3134        }
    3235}
  • doc/theses/andrew_beach_MMath/code/ThrowFinally.java

    rb7763da ree23a8d  
    2323                }
    2424
     25                long startTime = System.nanoTime();
    2526                for (int count = 0 ; count < times ; ++count) {
    2627                        try {
     
    3031                        }
    3132                }
     33                long endTime = System.nanoTime();
     34                System.out.println("Run-Time (ns) " + (endTime - startTime));
    3235        }
    3336}
  • doc/theses/andrew_beach_MMath/code/ThrowOther.java

    rb7763da ree23a8d  
    3434                }
    3535
     36                long startTime = System.nanoTime();
    3637                for (int count = 0 ; count < times ; ++count) {
    3738                        try {
     
    4344                        }
    4445                }
     46                long endTime = System.nanoTime();
     47                System.out.println("Run-Time (ns) " + (endTime - startTime));
    4548        }
    4649}
  • doc/theses/andrew_beach_MMath/code/cond-match-r.cfa

    rb7763da ree23a8d  
    11// Conditional Match (or Re-Raise)
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2426        unsigned int times = 1;
    2527        unsigned int total_frames = 1;
    26         if (2 < argc) {
     28        if (1 < argc) {
    2729                times = strtol(argv[1], 0p, 10);
    2830        }
    29         if (3 < argc) {
     31        if (2 < argc) {
    3032                total_frames = strtol(argv[2], 0p, 10);
    3133        }
    3234
     35        Time start_time = time();
    3336        for (unsigned int count = 0 ; count < times ; ++count) {
    3437                try {
     
    3841                }
    3942        }
     43        Time end_time = time();
     44        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    4045}
  • doc/theses/andrew_beach_MMath/code/cond-match.cfa

    rb7763da ree23a8d  
    11// Conditional Match (or Re-Raise)
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.h>
    46
     
    2325int main(int argc, char * argv[]) {
    2426        unsigned int times = 1;
    25         if (2 < argc) {
     27        if (1 < argc) {
    2628                times = strtol(argv[1], 0p, 10);
    2729        }
    2830
     31        Time start_time = time();
    2932        for (unsigned int count = 0 ; count < times ; ++count) {
    3033                try {
     
    3437                }
    3538        }
     39        Time end_time = time();
     40        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3641}
  • doc/theses/andrew_beach_MMath/code/cond-match.cpp

    rb7763da ree23a8d  
    11// Conditional Match (or Re-Raise)
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct EmptyException : public std::exception {};
     
    2428        unsigned int times = 1;
    2529        unsigned int total_frames = 1;
    26         if (2 < argc) {
     30        if (1 < argc) {
    2731                times = strtol(argv[1], nullptr, 10);
    2832        }
    29         if (3 < argc) {
     33        if (2 < argc) {
    3034                total_frames = strtol(argv[2], nullptr, 10);
    3135        }
    3236
     37        time_point<steady_clock> start_time = steady_clock::now();
    3338    for (unsigned int count = 0 ; count < times ; ++count) {
    3439        try {
     
    3843                }
    3944    }
     45        time_point<steady_clock> end_time = steady_clock::now();
     46        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
     47        std::cout << "Run-Time (ns): " << duration.count() << std::endl;
    4048}
  • doc/theses/andrew_beach_MMath/code/cross-catch.cfa

    rb7763da ree23a8d  
    11// Cross a Try Statement with a Termination Handler
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    810        unsigned int times = 1;
    911        unsigned int total_frames = 1;
    10         if (2 < argc) {
     12        if (1 < argc) {
    1113                times = strtol(argv[1], 0p, 10);
    1214        }
    13         if (3 < argc) {
     15        if (2 < argc) {
    1416                total_frames = strtol(argv[2], 0p, 10);
    1517        }
    1618
     19        Time start_time = time();
    1720        for (unsigned int count = 0 ; count < times ; ++count) {
    1821                try {
     
    2225                }
    2326        }
     27        Time end_time = time();
     28        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    2429}
  • doc/theses/andrew_beach_MMath/code/cross-catch.cpp

    rb7763da ree23a8d  
    11// Cross a Try Statement with a Termination Handler
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct NotRaisedException : public std::exception {};
     
    711int main(int argc, char * argv[]) {
    812        unsigned int times = 1;
    9         if (2 < argc) {
     13        if (1 < argc) {
    1014                times = strtol(argv[1], nullptr, 10);
    1115        }
    1216
     17        time_point<steady_clock> start_time = steady_clock::now();
    1318        for (unsigned int count = 0 ; count < times ; ++count) {
    1419                try {
     
    1823                }
    1924        }
     25        time_point<steady_clock> end_time = steady_clock::now();
     26        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
     27        std::cout << "Run-Time (ns): " << duration.count() << std::endl;
    2028}
  • doc/theses/andrew_beach_MMath/code/cross-finally.cfa

    rb7763da ree23a8d  
    11// Cross a Try Statement With Finally Clause
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    68        unsigned int times = 1;
    79        unsigned int total_frames = 1;
    8         if (2 < argc) {
     10        if (1 < argc) {
    911                times = strtol(argv[1], 0p, 10);
    1012        }
    11         if (3 < argc) {
     13        if (2 < argc) {
    1214                total_frames = strtol(argv[2], 0p, 10);
    1315        }
    1416
     17        Time start_time = time();
    1518        for (unsigned int count = 0 ; count < times ; ++count) {
    1619                 try {
     
    2023                }
    2124        }
     25        Time end_time = time();
     26        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    2227}
  • doc/theses/andrew_beach_MMath/code/cross-resume.cfa

    rb7763da ree23a8d  
    11// Cross a Try Statement With Finally Clause
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    810        unsigned int times = 1;
    911        unsigned int total_frames = 1;
    10         if (2 < argc) {
     12        if (1 < argc) {
    1113                times = strtol(argv[1], 0p, 10);
    1214        }
    13         if (3 < argc) {
     15        if (2 < argc) {
    1416                total_frames = strtol(argv[2], 0p, 10);
    1517        }
    1618
     19        Time start_time = time();
    1720        for (unsigned int count = 0 ; count < times ; ++count) {
    1821                try {
     
    2225                }
    2326        }
     27        Time end_time = time();
     28        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    2429}
  • doc/theses/andrew_beach_MMath/code/resume-detor.cfa

    rb7763da ree23a8d  
    11// Throw Across Destructor
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2628        unsigned int times = 1;
    2729        unsigned int total_frames = 1;
    28         if (2 < argc) {
     30        if (1 < argc) {
    2931                times = strtol(argv[1], 0p, 10);
    3032        }
    31         if (3 < argc) {
     33        if (2 < argc) {
    3234                total_frames = strtol(argv[2], 0p, 10);
    3335        }
    3436
     37        Time start_time = timeHiRes();
    3538    for (int count = 0 ; count < times ; ++count) {
    3639        try {
     
    4043        }
    4144    }
     45        Time end_time = timeHiRes();
     46        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    4247}
  • doc/theses/andrew_beach_MMath/code/resume-empty.cfa

    rb7763da ree23a8d  
    11// Resume Across Empty Function
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    911void unwind_empty(unsigned int frames) {
    1012        if (frames) {
    11 
    1213                unwind_empty(frames - 1);
    1314        } else {
     
    1920        unsigned int times = 1;
    2021        unsigned int total_frames = 1;
    21         if (2 < argc) {
     22        if (1 < argc) {
    2223                times = strtol(argv[1], 0p, 10);
    2324        }
    24         if (3 < argc) {
     25        if (2 < argc) {
    2526                total_frames = strtol(argv[2], 0p, 10);
    2627        }
    2728
     29        Time start_time = timeHiRes();
    2830        for (int count = 0 ; count < times ; ++count) {
    2931                try {
     
    3335                }
    3436        }
     37        Time end_time = timeHiRes();
     38        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3539}
  • doc/theses/andrew_beach_MMath/code/resume-finally.cfa

    rb7763da ree23a8d  
    11// Throw Across Finally
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2224        unsigned int times = 1;
    2325        unsigned int total_frames = 1;
    24         if (2 < argc) {
     26        if (1 < argc) {
    2527                times = strtol(argv[1], 0p, 10);
    2628        }
    27         if (3 < argc) {
     29        if (2 < argc) {
    2830                total_frames = strtol(argv[2], 0p, 10);
    2931        }
    3032
     33        Time start_time = timeHiRes();
    3134        for (int count = 0 ; count < times ; ++count) {
    3235                try {
     
    3639                }
    3740        }
     41        Time end_time = timeHiRes();
     42        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3843}
  • doc/theses/andrew_beach_MMath/code/resume-other.cfa

    rb7763da ree23a8d  
    11// Resume Across Other Handler
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2426        unsigned int times = 1;
    2527        unsigned int total_frames = 1;
    26         if (2 < argc) {
     28        if (1 < argc) {
    2729                times = strtol(argv[1], 0p, 10);
    2830        }
    29         if (3 < argc) {
     31        if (2 < argc) {
    3032                total_frames = strtol(argv[2], 0p, 10);
    3133        }
    3234
     35        Time start_time = timeHiRes();
    3336        for (int count = 0 ; count < times ; ++count) {
    3437                try {
     
    3841                }
    3942        }
     43        Time end_time = timeHiRes();
     44        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    4045}
  • doc/theses/andrew_beach_MMath/code/throw-detor.cfa

    rb7763da ree23a8d  
    11// Throw Across Destructor
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2527        unsigned int times = 1;
    2628        unsigned int total_frames = 1;
    27         if (2 < argc) {
     29        if (1 < argc) {
    2830                times = strtol(argv[1], 0p, 10);
    2931        }
    30         if (3 < argc) {
     32        if (2 < argc) {
    3133                total_frames = strtol(argv[2], 0p, 10);
    3234        }
    3335
     36        Time start_time = timeHiRes();
    3437        for (int count = 0 ; count < times ; ++count) {
    3538                try {
     
    3942                }
    4043        }
     44        Time end_time = timeHiRes();
     45        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    4146}
  • doc/theses/andrew_beach_MMath/code/throw-detor.cpp

    rb7763da ree23a8d  
    11// Throw Across Destructor
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct EmptyException : public std::exception {};
     
    2125        unsigned int times = 1;
    2226        unsigned int total_frames = 1;
    23         if (2 < argc) {
     27        if (1 < argc) {
    2428                times = strtol(argv[1], nullptr, 10);
    2529        }
    26         if (3 < argc) {
     30        if (2 < argc) {
    2731                total_frames = strtol(argv[2], nullptr, 10);
    2832        }
    2933
     34        time_point<steady_clock> start_time = steady_clock::now();
    3035        for (int count = 0 ; count < times ; ++count) {
    3136                try {
     
    3540                }
    3641        }
     42        time_point<steady_clock> end_time = steady_clock::now();
     43        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
     44        std::cout << "Run-Time (ns): " << duration.count() << std::endl;
    3745}
  • doc/theses/andrew_beach_MMath/code/throw-empty.cfa

    rb7763da ree23a8d  
    11// Throw Across Empty Function
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    1820        unsigned int times = 1;
    1921        unsigned int total_frames = 1;
    20         if (2 < argc) {
     22        if (1 < argc) {
    2123                times = strtol(argv[1], 0p, 10);
    2224        }
    23         if (3 < argc) {
     25        if (2 < argc) {
    2426                total_frames = strtol(argv[2], 0p, 10);
    2527        }
    2628
     29        Time start_time = timeHiRes();
    2730        for (unsigned int count = 0 ; count < times ; ++count) {
    2831                try {
     
    3235                }
    3336        }
     37        Time end_time = timeHiRes();
     38        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3439}
  • doc/theses/andrew_beach_MMath/code/throw-empty.cpp

    rb7763da ree23a8d  
    11// Throw Across Empty Function
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct EmptyException : public std::exception {};
     
    1620        unsigned int times = 1;
    1721        unsigned int total_frames = 1;
    18         if (2 < argc) {
     22        if (1 < argc) {
    1923                times = strtol(argv[1], nullptr, 10);
    2024        }
    21         if (3 < argc) {
     25        if (2 < argc) {
    2226                total_frames = strtol(argv[2], nullptr, 10);
    2327        }
    2428
     29        time_point<steady_clock> start_time = steady_clock::now();
    2530        for (unsigned int count = 0 ; count < times ; ++count) {
    2631                try {
     
    3035                }
    3136        }
     37        time_point<steady_clock> end_time = steady_clock::now();
     38        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
     39        std::cout << "Run-Time (ns): " << duration.count() << std::endl;
    3240}
  • doc/theses/andrew_beach_MMath/code/throw-finally.cfa

    rb7763da ree23a8d  
    11// Throw Across Finally
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2224        unsigned int times = 1;
    2325        unsigned int total_frames = 1;
    24         if (2 < argc) {
     26        if (1 < argc) {
    2527                times = strtol(argv[1], 0p, 10);
    2628        }
    27         if (3 < argc) {
     29        if (2 < argc) {
    2830                total_frames = strtol(argv[2], 0p, 10);
    2931        }
    3032
     33        Time start_time = timeHiRes();
    3134        for (int count = 0 ; count < times ; ++count) {
    3235                try {
     
    3639                }
    3740        }
     41        Time end_time = timeHiRes();
     42        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    3843}
  • doc/theses/andrew_beach_MMath/code/throw-other.cfa

    rb7763da ree23a8d  
    11// Throw Across Other Handler
     2#include <clock.hfa>
    23#include <exception.hfa>
     4#include <fstream.hfa>
    35#include <stdlib.hfa>
    46
     
    2426        unsigned int times = 1;
    2527        unsigned int total_frames = 1;
    26         if (2 < argc) {
     28        if (1 < argc) {
    2729                times = strtol(argv[1], 0p, 10);
    2830        }
    29         if (3 < argc) {
     31        if (2 < argc) {
    3032                total_frames = strtol(argv[2], 0p, 10);
    3133        }
    3234
     35        Time start_time = timeHiRes();
    3336        for (int count = 0 ; count < times ; ++count) {
    3437                try {
     
    3841                }
    3942        }
     43        Time end_time = timeHiRes();
     44        sout | "Run-Time (ns): " | (end_time - start_time)`ns;
    4045}
  • doc/theses/andrew_beach_MMath/code/throw-other.cpp

    rb7763da ree23a8d  
    11// Throw Across Other Handler
     2#include <chrono>
     3#include <cstdlib>
    24#include <exception>
    3 #include <cstdlib>
     5#include <iostream>
     6
     7using namespace std::chrono;
    48
    59struct EmptyException : public std::exception {};
     
    2226        unsigned int times = 1;
    2327        unsigned int total_frames = 1;
    24         if (2 < argc) {
     28        if (1 < argc) {
    2529                times = strtol(argv[1], nullptr, 10);
    2630        }
    27         if (3 < argc) {
     31        if (2 < argc) {
    2832                total_frames = strtol(argv[2], nullptr, 10);
    2933        }
    3034
     35        time_point<steady_clock> start_time = steady_clock::now();
    3136        for (int count = 0 ; count < times ; ++count) {
    3237                try {
     
    3641                }
    3742        }
     43        time_point<steady_clock> end_time = steady_clock::now();
     44        nanoseconds duration = duration_cast<nanoseconds>(end_time - start_time);
     45        std::cout << "Run-Time (ns): " << duration.count() << std::endl;
    3846}
Note: See TracChangeset for help on using the changeset viewer.