Ignore:
Timestamp:
Jul 7, 2021, 11:56:29 AM (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:
47e413b
Parents:
acb38ce9
Message:

Updated the Java exception benchmarks to provide some warm-up. Does not appear to change results.

File:
1 edited

Legend:

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

    racb38ce9 r11d4fa5  
    1212        }
    1313
     14        private static long loop(int times, int total_frames) {
     15                long startTime = System.nanoTime();
     16                for (int count = 0 ; count < times ; ++count) {
     17                        try {
     18                                unwind_empty(total_frames);
     19                        } catch (EmptyException e) {
     20                                // ...
     21                        }
     22                }
     23                long endTime = System.nanoTime();
     24                return endTime - startTime;
     25        }
     26
    1427        public static void main(String[] args) {
    1528                int times = 1;
     
    2235                }
    2336
    24                 long startTime = System.nanoTime();
    25                 for (int count = 0 ; count < times ; ++count) {
    26                         try {
    27                                 unwind_empty(total_frames);
    28                         } catch (EmptyException e) {
    29                                 // ...
    30                         }
    31                 }
    32                 long endTime = System.nanoTime();
    33                 System.out.println("Run-Time (ns) " + (endTime - startTime));
     37                // Warm-Up:
     38                loop(1000, total_frames);
     39
     40                long time = loop(times, total_frames);
     41                System.out.println("Run-Time (ns): " + time);
    3442        }
    3543}
Note: See TracChangeset for help on using the changeset viewer.