ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change
on this file since b276be5 was
b276be5,
checked in by Aaron Moss <a3moss@…>, 7 years ago
|
Further updates to benchmarks (new C++ virtual benchmark still slightly broken)
|
-
Property mode set to
100644
|
File size:
372 bytes
|
Rev | Line | |
---|
[b276be5] | 1 | #include <stdlib.h> |
---|
| 2 | #include "bench.hpp" |
---|
| 3 | #include "cpp-vstack.hpp" |
---|
| 4 | |
---|
| 5 | int main(int argc, char** argv) { |
---|
| 6 | srand(20171025); |
---|
| 7 | |
---|
| 8 | stack s; |
---|
| 9 | REPEAT_TIMED( "push_int", |
---|
| 10 | s.push( std::make_unique<integer>( rand() ) ); |
---|
| 11 | ) |
---|
| 12 | |
---|
| 13 | stack t; |
---|
| 14 | TIMED( "copy_int", |
---|
| 15 | t = s; |
---|
| 16 | ) |
---|
| 17 | |
---|
| 18 | TIMED( "clear_int", |
---|
| 19 | s.clear(); |
---|
| 20 | ) |
---|
| 21 | |
---|
| 22 | integer sum; |
---|
| 23 | REPEAT_TIMED( "pop_int", |
---|
| 24 | sum += t.pop()->as<integer>(); |
---|
| 25 | ) |
---|
| 26 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.