Ignore:
Timestamp:
Apr 11, 2017, 5:11:55 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
4f57930
Parents:
e6dceef
Message:

Update benchmarks to include stack of pairs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cfa-bench.c

    re6dceef r87c5f40  
     1#include <stdlib>
    12#include <stdlib.h>
     3#include "pair"
    24#include "bench.h"
    35#include "cfa-stack.h"
     
    2022        )
    2123
    22         int sum;
     24        int max = 0;
    2325        REPEAT_TIMED( "pop_int",
    24                 sum += pop( &t );
     26                max = max( max, pop( &t ) );
     27        )
     28
     29        stack(pair(_Bool, unsigned char)) s2;
     30        REPEAT_TIMED( "push_bool_char",
     31                push( &s2, (pair(_Bool, unsigned char)){ rand() & 0x1, rand() & 0x7F } );
     32        )
     33
     34        stack(pair(_Bool, unsigned char)) t2;
     35        TIMED( "copy_bool_char",
     36                t2 = s2;
     37        )
     38
     39        TIMED( "clear_bool_char",
     40                clear( &s2 );
     41        )
     42
     43        pair(_Bool, unsigned char) max2 = { (_Bool)0, '\0' };
     44        REPEAT_TIMED( "pop_bool_char",
     45                max2 = max( max2, pop( &t2 ) );
    2546        )
    2647}
Note: See TracChangeset for help on using the changeset viewer.