Changeset b4107c8 for benchmark/schedint


Ignore:
Timestamp:
Jan 7, 2020, 3:50:56 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
580c11b
Parents:
846c026
Message:

update existing benchmarks for changes to bench.h, add new benchmarks in new programming languages

Location:
benchmark/schedint
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • benchmark/schedint/JavaThread.java

    r846c026 rb4107c8  
    4949        static int x = 2;
    5050
    51         static private final int NoOfTimes = Integer.parseInt("1000000") ;
     51        static private int times = Integer.parseInt("1000000");
    5252
    5353        public static void helper( Monitor m ) throws InterruptedException {
    54                 for(int i = 1; i <= NoOfTimes; i += 1) {
     54                for(int i = 1; i <= times; i += 1) {
    5555                        m.wait();               // relase monitor lock
    5656                        m.next = true;
     
    7272                Monitor.go = false;
    7373                s.join();
    74                 System.out.println( (end - start) / NoOfTimes);
     74                System.out.println( (end - start) / times);
    7575        }
    7676        public static void main(String[] args) throws InterruptedException {
     77                if ( args.length > 2 ) System.exit( 1 );
     78                if ( args.length == 2 ) { times = Integer.parseInt(args[1]); }
     79
    7780                for (int n = Integer.parseInt("5"); --n >= 0 ; ) {
    7881                        InnerMain();
     
    8386        }
    8487}
     88
     89// Local Variables: //
     90// tab-width: 4 //
     91// End: //
  • benchmark/schedint/cfa1.cfa

    r846c026 rb4107c8  
    66#include "bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
     
    2624                result
    2725        )
    28 
    29         printf("%g\n", result);
     26        printf( "%g\n", result );
    3027        go = 0;
    3128        return 0;
     
    4037}
    4138
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     39int main( int argc, char * argv[] ) {
     40        BENCH_START()
    4341        T t;
    4442        return wait(m1);
    4543}
     44
     45// Local Variables: //
     46// tab-width: 4 //
     47// End: //
  • benchmark/schedint/cfa2.cfa

    r846c026 rb4107c8  
    66#include "bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
     
    2624                result
    2725        )
    28 
    29         printf("%g\n", result);
     26        printf( "%g\n", result );
    3027        go = 0;
    3128        return 0;
     
    4037}
    4138
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     39int main( int argc, char * argv[] ) {
     40        BENCH_START()
    4341        T t;
    4442        return wait(m1, m2);
    4543}
     44
     45// Local Variables: //
     46// tab-width: 4 //
     47// End: //
  • benchmark/schedint/cfa4.cfa

    r846c026 rb4107c8  
    66#include "bench.h"
    77
    8 int argc;
    9 char** argv;
    108volatile int go = 0;
    119
     
    2624                result
    2725        )
    28 
    29         printf("%g\n", result);
     26        printf( "%g\n", result );
    3027        go = 0;
    3128        return 0;
     
    4037}
    4138
    42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     39int main( int argc, char * argv[] ) {
     40        BENCH_START()
    4341        T t;
    4442        return wait(m1, m2, m3, m4);
    4543}
     44
     45// Local Variables: //
     46// tab-width: 4 //
     47// End: //
  • benchmark/schedint/pthreads.c

    r846c026 rb4107c8  
    44#include "bench.h"
    55
    6 int argc;
    7 char** argv;
    86volatile int go = 0;
    97
     
    2119        go = 1;
    2220        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     21                for (size_t i = 0; i < times; i++) {
    2422                        pthread_cond_wait(&c, &m);
    2523                },
    2624                result
    2725        )
    28 
    29         printf("%g\n", result);
     26        printf( "%g\n", result );
    3027        go = 0;
    3128        pthread_mutex_unlock(&m);
     
    3936}
    4037
    41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     38int main( int argc, char * argv[] ) {
     39        BENCH_START()
    4240        pthread_t thread;
    4341        if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
     
    5048                return 1;
    5149        }
    52         return 0;
    5350}
     51
     52// Local Variables: //
     53// tab-width: 4 //
     54// End: //
  • benchmark/schedint/upp.cc

    r846c026 rb4107c8  
    33#include "bench.h"
    44
    5 int argc;
    6 char** argv;
    75volatile int go = 0;
    86
     
    2220                        result
    2321                )
    24 
    25                 printf("%g\n", result);
     22                printf( "%g\n", result );
    2623                go = 0;
    2724                return 0;
     
    3936};
    4037
    41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
     38int main( int argc, char * argv[] ) {
     39        BENCH_START()
    4240        T t;
    4341        return m.wait();
    4442}
     43
     44// Local Variables: //
     45// tab-width: 4 //
     46// End: //
Note: See TracChangeset for help on using the changeset viewer.