Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[GH #175] Slightly reorganise current and add new sort benchmarks #950

Merged
merged 8 commits into from

2 participants

@paultcochrane

These patches do some slight reorganisation of the existing sort benchmarks and add two new sort benchmarks: one for ResizableIntegerArray and one for ResizableFloatArray.

Here are the timing results on my Debian wheezy (amd64) system (Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz), just in case anyone's interested:

time ./parrot examples/benchmarks/sort_ffa.pir
Sorted 1000000 floats

real    0m0.797s
user    0m0.704s
sys 0m0.028s

time ./parrot examples/benchmarks/sort_fia.pir
Sorted 1000000 integers

real    0m0.666s
user    0m0.648s
sys 0m0.020s

time ./parrot examples/benchmarks/sort_rfa.pir
Sorted 1000000 floats

real    0m0.730s
user    0m0.704s
sys 0m0.020s

time ./parrot examples/benchmarks/sort_ria.pir
Sorted 1000000 integers

real    0m0.754s
user    0m0.680s
sys 0m0.020s
paultcochrane added some commits
@paultcochrane paultcochrane [GH #175] sort.pir benchmark reports how many elements were sorted
This gives us output which can be checked in the benchmarks.t test, such
that the sort.pir test can be added to the benchmarks test suite
38f41b7
@paultcochrane paultcochrane [GH #175] Add the sort benchmark to the benchmark test suite d3c828a
@paultcochrane paultcochrane [GH #175] sort_ffa.pir benchmark prints number of elements sorted
It's good to see that a program gives some output to the user, so that we
know that *something* happened.  Now we have this output and can add the
relevant search in the benchmarks.t test suite.
43c83b1
@paultcochrane paultcochrane [GH #175] Added sort_ffa.pir benchmark to main benchmark suite ae87849
@paultcochrane paultcochrane [GH #175] Renamed sort.pir benchmark to sort_fia.pir
This makes it more obvious that this benchmark is for sorting
FixedIntegerArrays in much the same way that sort_ffa.pir benchmarks sorting
FixedFloatarrays
63affbc
@paultcochrane paultcochrane [GH #175] Correct typo in sort_fia.pir POD bd184ce
@paultcochrane paultcochrane [GH #175] Added a sort benchmark for ResizableIntegerArrays 7922f60
@paultcochrane paultcochrane [GH #175] Added a sort benchmark for ResizableFloatArrays 8b8110c
@leto
Owner

Looks great! I don't think we will see much of huge difference in the timings for these benchmarks when run on a single commit of Parrot, but my hunch is that they will be useful to track the general performance of Parrot for various different commits.

@leto leto merged commit 6a7f23f into from
@paultcochrane paultcochrane deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 24, 2013
  1. @paultcochrane

    [GH #175] sort.pir benchmark reports how many elements were sorted

    paultcochrane authored
    This gives us output which can be checked in the benchmarks.t test, such
    that the sort.pir test can be added to the benchmarks test suite
  2. @paultcochrane
  3. @paultcochrane

    [GH #175] sort_ffa.pir benchmark prints number of elements sorted

    paultcochrane authored
    It's good to see that a program gives some output to the user, so that we
    know that *something* happened.  Now we have this output and can add the
    relevant search in the benchmarks.t test suite.
  4. @paultcochrane
  5. @paultcochrane

    [GH #175] Renamed sort.pir benchmark to sort_fia.pir

    paultcochrane authored
    This makes it more obvious that this benchmark is for sorting
    FixedIntegerArrays in much the same way that sort_ffa.pir benchmarks sorting
    FixedFloatarrays
  6. @paultcochrane
  7. @paultcochrane
  8. @paultcochrane
This page is out of date. Refresh to see the latest.
View
4 examples/benchmarks/sort_ffa.pir
@@ -46,6 +46,10 @@ LOOP:
$P0.'sort'()
+ print "Sorted "
+ print N
+ print " floats\n"
+
.end
View
12 examples/benchmarks/sort.pir → examples/benchmarks/sort_fia.pir
@@ -6,16 +6,16 @@ examples/benchmarks/sort.pir - Sort an FixedIntegerArray of N integers
=head1 SYNOPSIS
- % time ./parrot examples/benchmarks/sort.pir 100000
+ % time ./parrot examples/benchmarks/sort_fia.pir 100000
Or use the default number of iterations:
- % time ./parrot examples/benchmarks/sort.pir
+ % time ./parrot examples/benchmarks/sort_fia.pir
=head1 DESCRIPTION
-Sorts an FixedIntegetArray of N random integers using builtin sort
-function for FixedIntegetArray. The argument N is specified from the
+Sorts an FixedIntegerArray of N random integers using builtin sort
+function for FixedIntegerArray. The argument N is specified from the
command line.
=cut
@@ -46,6 +46,10 @@ LOOP:
$P0.'sort'()
+ print "Sorted "
+ print N
+ print " integers\n"
+
.end
View
61 examples/benchmarks/sort_rfa.pir
@@ -0,0 +1,61 @@
+# Copyright (C) 2013, Parrot Foundation.
+
+=head1 NAME
+
+examples/benchmarks/sort_rfa.pir - Sort a ResizableFloatArray of N floats
+
+=head1 SYNOPSIS
+
+ % time ./parrot examples/benchmarks/sort_rfa.pir 100000
+
+Or use the default number of iterations:
+
+ % time ./parrot examples/benchmarks/sort_rfa.pir
+
+=head1 DESCRIPTION
+
+Sorts an ResizableFloatArray of N random integers using builtin sort
+function for ResizableFloatArray. The argument N is specified from the
+command line.
+
+=cut
+
+.loadlib 'math_ops'
+
+.sub main :main
+ .param pmc argv
+ .local int N, i, j
+
+ N = argv[1]
+ if N < 1 goto USE_DEFAULT_SIZE
+ goto USE_DEFINED_SIZE
+
+USE_DEFAULT_SIZE:
+ N = 1000000
+
+USE_DEFINED_SIZE:
+ $P0 = new ['ResizableFloatArray'], N
+ i = 0
+ j = 0
+
+LOOP:
+ j = rand 0, N
+ $P0[i] = j
+ inc i
+ if i < N goto LOOP
+
+ $P0.'sort'()
+
+ print "Sorted "
+ print N
+ print " floats\n"
+
+.end
+
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
View
61 examples/benchmarks/sort_ria.pir
@@ -0,0 +1,61 @@
+# Copyright (C) 2013, Parrot Foundation.
+
+=head1 NAME
+
+examples/benchmarks/sort_ria.pir - Sort a ResizableIntegerArray of N integers
+
+=head1 SYNOPSIS
+
+ % time ./parrot examples/benchmarks/sort_ria.pir 100000
+
+Or use the default number of iterations:
+
+ % time ./parrot examples/benchmarks/sort_ria.pir
+
+=head1 DESCRIPTION
+
+Sorts an ResizableIntegerArray of N random integers using builtin sort
+function for ResizableIntegerArray. The argument N is specified from the
+command line.
+
+=cut
+
+.loadlib 'math_ops'
+
+.sub main :main
+ .param pmc argv
+ .local int N, i, j
+
+ N = argv[1]
+ if N < 1 goto USE_DEFAULT_SIZE
+ goto USE_DEFINED_SIZE
+
+USE_DEFAULT_SIZE:
+ N = 1000000
+
+USE_DEFINED_SIZE:
+ $P0 = new ['ResizableIntegerArray'], N
+ i = 0
+ j = 0
+
+LOOP:
+ j = rand 0, N
+ $P0[i] = j
+ inc i
+ if i < N goto LOOP
+
+ $P0.'sort'()
+
+ print "Sorted "
+ print N
+ print " integers\n"
+
+.end
+
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
+
View
4 t/benchmark/benchmarks.t
@@ -164,6 +164,10 @@ FixedPMCArray:\s\d+\.\d+s\n
is\s1230\nlast\sis:\s9973\n$/x,
q{primes_i.pasm} => qr/^N\sprimes\sup\sto\s10000\sis:\s1229\n
last\sis:\s9973\nElapsed\stime:\s\d+\.\d+\n$/x,
+ q{sort_ffa.pir} => qr/Sorted 1000000 floats/,
+ q{sort_fia.pir} => qr/Sorted 1000000 integers/,
+ q{sort_rfa.pir} => qr/Sorted 1000000 floats/,
+ q{sort_ria.pir} => qr/Sorted 1000000 integers/,
q{stress.pasm} => qr/^A\stotal\sof\s\d+\sGC\sruns\s
were\smade\n$/x,
q{stress1.pasm} => qr/^\d+\.\d+\n
Something went wrong with that request. Please try again.