Changes in / [7a054e82:b715c9a]
- Location:
- doc/generic_types/evaluation
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/Makefile
r7a054e82 rb715c9a 55 55 56 56 run-c: c-bench 57 @echo 57 58 @echo '## C ##' 58 @ ./c-bench59 @printf 'source_size:\t% 7d lines\n' `cat c-bench.c bench.h c-stack.h c-stack.c | wc -l`60 @printf 'binary_size:\t% 7d bytes\n' `wc -c <c-bench`59 @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./c-bench 60 @printf 'source_size:\t%8d lines\n' `cat c-bench.c bench.h c-stack.h c-stack.c | wc -l` 61 @printf 'binary_size:\t%8d bytes\n' `stat -c %s c-bench` 61 62 62 63 run-cfa: cfa-bench 64 @echo 63 65 @echo '## Cforall ##' 64 @ ./cfa-bench65 @printf 'source_size:\t% 7d lines\n' `cat cfa-bench.c bench.h cfa-stack.h cfa-stack.c | wc -l`66 @printf 'binary_size:\t% 7d bytes\n' `wc -c <cfa-bench`66 @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cfa-bench 67 @printf 'source_size:\t%8d lines\n' `cat cfa-bench.c bench.h cfa-stack.h cfa-stack.c | wc -l` 68 @printf 'binary_size:\t%8d bytes\n' `stat -c %s cfa-bench` 67 69 68 70 run-cpp: cpp-bench 71 @echo 69 72 @echo '## C++ ##' 70 @ ./cpp-bench71 @printf 'source_size:\t% 7d lines\n' `cat cpp-bench.cpp bench.hpp cpp-stack.hpp | wc -l`72 @printf 'binary_size:\t% 7d bytes\n' `wc -c <cpp-bench`73 @/usr/bin/time -f 'max_memory:\t %M kilobytes' ./cpp-bench 74 @printf 'source_size:\t%8d lines\n' `cat cpp-bench.cpp bench.hpp cpp-stack.hpp | wc -l` 75 @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-bench` 73 76 74 77 run-cppv: cpp-vbench 78 @echo 75 79 @echo '## C++ virtual ##' 76 @ ./cpp-vbench77 @printf 'source_size:\t% 7d lines\n' `cat cpp-vbench.cpp bench.hpp object.hpp cpp-vstack.hpp cpp-vstack.cpp | wc -l`78 @printf 'binary_size:\t% 7d bytes\n' `wc -c <cpp-vbench`80 @/usr/bin/time -f 'max_memory:\t%M kilobytes' ./cpp-vbench 81 @printf 'source_size:\t%8d lines\n' `cat cpp-vbench.cpp bench.hpp object.hpp cpp-vstack.hpp cpp-vstack.cpp | wc -l` 82 @printf 'binary_size:\t%8d bytes\n' `stat -c %s cpp-vbench` 79 83 80 84 run: run-c run-cfa run-cpp run-cppv -
doc/generic_types/evaluation/bench.h
r7a054e82 rb715c9a 4 4 #include <time.h> 5 5 6 #define N 100000000 7 6 #define N 100000000 8 7 9 8 long ms_between(clock_t start, clock_t end) { … … 16 15 code \ 17 16 _end = clock(); \ 18 printf("%s:\t% 7ld ms\n", name, ms_between(_start, _end)); \17 printf("%s:\t%8ld ms\n", name, ms_between(_start, _end)); \ 19 18 } 20 19 -
doc/generic_types/evaluation/bench.hpp
r7a054e82 rb715c9a 5 5 #include <time.h> 6 6 7 #define N 100000000 8 7 static const int N = 100000000; 9 8 10 9 long ms_between(clock_t start, clock_t end) { … … 17 16 code \ 18 17 _end = clock(); \ 19 std::cout << name << ":\t" << std::setw( 7) << ms_between(_start, _end) << std::setw(0) << " ms" << std::endl; \18 std::cout << name << ":\t" << std::setw(8) << ms_between(_start, _end) << std::setw(0) << " ms" << std::endl; \ 20 19 } 21 20 -
doc/generic_types/evaluation/cfa-stack.c
r7a054e82 rb715c9a 59 59 s->head = n->next; 60 60 T x = n->value; 61 delete(n); 61 ^n{}; 62 free(n); 62 63 return x; 63 64 } -
doc/generic_types/evaluation/cpp-vstack.cpp
r7a054e82 rb715c9a 25 25 delete crnt; 26 26 } 27 head = nullptr; 27 28 } 28 29
Note: See TracChangeset
for help on using the changeset viewer.