Skip to content

Commit

Permalink
Missing Import
Browse files Browse the repository at this point in the history
Benchmark script
  • Loading branch information
jdunkerley committed Feb 14, 2022
1 parent c71122c commit de53c0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions distribution/lib/Standard/Test/0.0.0-dev/src/Faker.enso
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from Standard.Base import all

polyglot java import java.util.Random
polyglot java import org.enso.base.Text_Utils

upper_case_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".utf_8
numbers = "0123456789".utf_8
Expand Down
24 changes: 24 additions & 0 deletions test/Benchmarks/src/Natural_Order_Sort.enso
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from Standard.Base import all

import Standard.Test.Bench

import Standard.Test.Faker
import Standard.Base.Data.Ordering.Natural_Order

## Bench Utilities ============================================================

vector_size = 10000
iter_size = 100
num_iterations = 10


# The Benchmarks ==============================================================

main =
l = Faker.upper_case_letters
n = Faker.numbers
template = [l, l, l, n, n, n, n, n, l]
random_generator = Faker.make_generator 1644575867
unsorted = 0.up_to here.vector_size . map _->(Faker.make_string template random_generator)

Bench.measure (unsorted.sort by=Natural_Order.compare) "Natural Order" here.iter_size here.num_iterations

0 comments on commit de53c0f

Please sign in to comment.