Changeset ab16fc5
- Timestamp:
- Apr 17, 2017, 5:04:24 PM (8 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/generic_types.tex
reb79750 rab16fc5 950 950 This 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}). 951 951 Since 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 t o show the costs of idiomatic useof each language's features covering common usage.952 A more illustrative benchmark is the idiomatic costs of each language's features covering common usage. 953 953 Figure~\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}. 954 954 The 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.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/2$ (to reduce graph height) constants. 956 956 957 957 The 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. … … 973 973 TIMED( "clear_int", clear( &si ); ) 974 974 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; } ) 977 976 REPEAT_TIMED( "print_int", N/2, print( out, vali, ":", vali, "\n" ); ) 978 977 … … 984 983 TIMED( "clear_pair", clear( &sp ); ) 985 984 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; } ) 988 986 REPEAT_TIMED( "print_pair", N/2, print( out, valp, ":", valp, "\n" ); ) 989 987 fclose(out);
Note: See TracChangeset
for help on using the changeset viewer.