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/ThrowFinally.java

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