Last change
on this file since ead3858 was
fb2ce27,
checked in by Aaron Moss <a3moss@…>, 6 years ago
|
Update all benchmarks to match new CFA
|
-
Property mode set to
100644
|
File size:
783 bytes
|
Rev | Line | |
---|
[604e76d] | 1 | #include <algorithm> |
---|
| 2 | #include "bench.hpp" |
---|
| 3 | #include "cpp-vstack.hpp" |
---|
| 4 | #include "object.hpp" |
---|
| 5 | |
---|
| 6 | int main(int argc, char** argv) { |
---|
| 7 | integer maxi{ 0 }, vali{ 42 }; |
---|
| 8 | stack si, ti; |
---|
| 9 | |
---|
| 10 | REPEAT_TIMED( "push_int", N, si.push( vali ); ) |
---|
| 11 | TIMED( "copy_int", ti = si; ) |
---|
| 12 | TIMED( "clear_int", si.clear(); ) |
---|
| 13 | REPEAT_TIMED( "pop_int", N, maxi = std::max( maxi, ti.pop()->as<integer>() ); /***/ ) |
---|
| 14 | |
---|
[fb2ce27] | 15 | ptr<pair> maxp = make<pair>( make<short_integer>(0), make<character>('\0') ); |
---|
| 16 | pair valp{ make<short_integer>(42), make<character>('a') }; |
---|
[604e76d] | 17 | stack sp, tp; |
---|
| 18 | |
---|
| 19 | REPEAT_TIMED( "push_pair", N, sp.push( valp ); ) |
---|
| 20 | TIMED( "copy_pair", tp = sp; ) |
---|
| 21 | TIMED( "clear_pair", sp.clear(); ) |
---|
| 22 | REPEAT_TIMED( "pop_pair", N, |
---|
| 23 | ptr<pair> xp = as_ptr<pair>( tp.pop() ); /***/ |
---|
| 24 | if ( *xp > *maxp ) { maxp = std::move(xp); } ) |
---|
| 25 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.