Changeset ab16fc5 for doc


Ignore:
Timestamp:
Apr 17, 2017, 5:04:24 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
2b8a897, bb91487
Parents:
eb79750
Message:

extra changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/generic_types.tex

    reb79750 rab16fc5  
    950950This claim is demonstrated through a set of generic-code-based micro-benchmarks in C, \CFA, and \CC (see stack implementations in Appendix~\ref{sec:BenchmarkStackImplementation}).
    951951Since all these languages share a subset comprising standard C, maximal-performance benchmarks would show little runtime variance, other than in length and clarity of source code.
    952 A more illustrative benchmark is to show the costs of idiomatic use of each language's features covering common usage.
     952A more illustrative benchmark is the idiomatic costs of each language's features covering common usage.
    953953Figure~\ref{fig:BenchmarkTest} shows the \CFA benchmark tests for a generic stack based on a singly linked-list, a generic pair-data-structure, and a variadic @print@ routine similar to that in Section~\ref{sec:variadic-tuples}.
    954954The benchmark test is similar for C and \CC.
    955 The experiment uses element types @int@ and @pair(_Bool, char)@, and pushes $N=40M$ elements on a generic stack, copies the stack, clears one of the stacks, finds the maximum value in the other stack, and prints $N$ constant values.
     955The experiment uses element types @int@ and @pair(_Bool, char)@, and pushes $N=40M$ elements on a generic stack, copies the stack, clears one of the stacks, finds the maximum value in the other stack, and prints $N/2$ (to reduce graph height) constants.
    956956
    957957The structure of each benchmark implemented is: C with @void *@-based polymorphism, \CFA with the presented features, \CC with templates, and \CC using only class inheritance for polymorphism, called \CCV.
     
    973973        TIMED( "clear_int", clear( &si ); )
    974974        REPEAT_TIMED( "pop_int", N,
    975                 int xi = pop( &ti );
    976                 if ( xi > maxi ) { maxi = xi; } )
     975                int xi = pop( &ti ); if ( xi > maxi ) { maxi = xi; } )
    977976        REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); )
    978977
     
    984983        TIMED( "clear_pair", clear( &sp ); )
    985984        REPEAT_TIMED( "pop_pair", N,
    986                 pair(_Bool, char) xp = pop( &tp );
    987                 if ( xp > maxp ) { maxp = xp; } )
     985                pair(_Bool, char) xp = pop( &tp ); if ( xp > maxp ) { maxp = xp; } )
    988986        REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); )
    989987        fclose(out);
Note: See TracChangeset for help on using the changeset viewer.