Skip to content

Commit

Permalink
Update Sort comparison tests
Browse files Browse the repository at this point in the history
These tests are not run in any testing config & only run manually.

---
Signed-off-by: Michael Ferguson <[email protected]>
  • Loading branch information
mppf committed Dec 8, 2023
1 parent 0d0d620 commit 76d15ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// chpl --fast chapel-quicksort-random.chpl

use Sort;
use QuickSort;
use Time;
use Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import random
import time

#n = 1024*1024*16 # for 128MiB
n = 1024*1024*128 # for 1GiB
#n = 1024*1024*16 # for 16MiB
n = 1024*1024*128 # for 128MiB

# Note, this actually never generates the maximal element... oh well.
array = numpy.random.randint(0, 0xffffffffffffffff, size=n, dtype=numpy.uint64)

start = time.clock()
start = time.time()
array.sort()
stop = time.clock()
stop = time.time()

print ("Sorted ", n, " elements in ", stop-start, " seconds")
print (((8*n) / (stop-start))/1024.0/1024.0, " MiB/s")
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import random
import time

#n = 1024*1024*16 # for 128MiB
n = 1024*1024*128 # for 1GiB
#n = 1024*1024*16 # for 16MiB
n = 1024*1024*128 # for 128MiB

array = [random.randint(0, 0xffffffffffffffff) for _ in range(n)]
start = time.clock()
start = time.time()
array.sort()
stop = time.clock()
stop = time.time()

print ("Sorted ", n, " elements in ", stop-start, " seconds")
print (((8*n) / (stop-start))/1024.0/1024.0, " MiB/s")

0 comments on commit 76d15ad

Please sign in to comment.