Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove the old .nqp-based benchmarks. Replace with a series of pir-ba…
…sed benchmarks with a factored library file
- Loading branch information
1 parent
4861ec0
commit cb7ecff
Showing
12 changed files
with
163 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
.sub push_shift_benchmarks | ||
.param string targettype | ||
.param int numtrials | ||
.param int preallocate | ||
|
||
$P0 = new [targettype] | ||
$P1 = new ['Integer'] | ||
$P1 = 5 | ||
$I0 = numtrials | ||
$N0 = time | ||
|
||
if preallocate goto preallocate_storage | ||
goto storage_is_ok | ||
preallocate_storage: | ||
$P0 = numtrials | ||
storage_is_ok: | ||
|
||
push_loop_top: | ||
push $P0, $P1 | ||
$I0 = $I0 - 1 | ||
if $I0 == 0 goto push_loop_bottom | ||
goto push_loop_top | ||
push_loop_bottom: | ||
$N1 = time | ||
$I0 = numtrials | ||
shift_loop_top: | ||
$P2 = shift $P0 | ||
$I0 = $I0 - 1 | ||
if $I0 == 0 goto shift_loop_bottom | ||
goto shift_loop_top | ||
shift_loop_bottom: | ||
$N2 = time | ||
$N3 = $N1 - $N0 | ||
$N4 = $N2 - $N1 | ||
$N5 = $N2 - $N0 | ||
print_partial_result(targettype, "push ", numtrials, $N3) | ||
print_partial_result(targettype, "shift", numtrials, $N4) | ||
print_partial_result(targettype, "total", numtrials, $N5) | ||
.end | ||
|
||
.sub push_pop_benchmarks | ||
.param string targettype | ||
.param int numtrials | ||
.param int preallocate | ||
|
||
$P0 = new [targettype] | ||
$P1 = new ['Integer'] | ||
$P1 = 5 | ||
$I0 = numtrials | ||
$N0 = time | ||
|
||
if preallocate goto preallocate_storage | ||
goto storage_is_ok | ||
preallocate_storage: | ||
$P0 = numtrials | ||
storage_is_ok: | ||
|
||
push_loop_top: | ||
push $P0, $P1 | ||
$I0 = $I0 - 1 | ||
if $I0 == 0 goto push_loop_bottom | ||
goto push_loop_top | ||
push_loop_bottom: | ||
$N1 = time | ||
$I0 = numtrials | ||
shift_loop_top: | ||
$P2 = pop $P0 | ||
$I0 = $I0 - 1 | ||
if $I0 == 0 goto shift_loop_bottom | ||
goto shift_loop_top | ||
shift_loop_bottom: | ||
$N2 = time | ||
$N3 = $N1 - $N0 | ||
$N4 = $N2 - $N1 | ||
$N5 = $N2 - $N0 | ||
print_partial_result(targettype, "push ", numtrials, $N3) | ||
print_partial_result(targettype, "pop ", numtrials, $N4) | ||
print_partial_result(targettype, "total", numtrials, $N5) | ||
.end | ||
|
||
.sub print_partial_result | ||
.param string targettype | ||
.param string operation | ||
.param int numtrials | ||
.param num totaltime | ||
|
||
print "(" | ||
print targettype | ||
print ") Time to " | ||
print operation | ||
print " " | ||
print numtrials | ||
print ": " | ||
say totaltime | ||
.end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.sub main :main | ||
.local pmc pds | ||
pds = loadlib "./dynext/pds_group" | ||
if pds goto has_pds_group | ||
exit 1 | ||
has_pds_group: | ||
push_shift_benchmarks("FixedPMCQueue", 100000, 1) | ||
say "" | ||
.end | ||
|
||
.include "benchmarks/benchmarker.pir" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.sub main :main | ||
.local pmc pds | ||
pds = loadlib "./dynext/pds_group" | ||
if pds goto has_pds_group | ||
exit 1 | ||
has_pds_group: | ||
push_pop_benchmarks("FixedPMCStack", 1000000, 1) | ||
say "" | ||
.end | ||
|
||
.include "benchmarks/benchmarker.pir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.sub main :main | ||
.local pmc pds | ||
pds = loadlib "./dynext/pds_group" | ||
if pds goto has_pds_group | ||
exit 1 | ||
has_pds_group: | ||
push_pop_benchmarks("ResizablePMCArray", 1000000, 0) | ||
say "" | ||
push_shift_benchmarks("ResizablePMCArray", 100000, 0) | ||
say "" | ||
.end | ||
|
||
.include "benchmarks/benchmarker.pir" |
Oops, something went wrong.