Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add alpha and numeric keyed Hash workloads
Set the env var `N` to specify the size of the Hash to test. For example, in a Windows CMD.EXE: for %I in (1,2) do @set N=%I && @echo N=%I && rci bench core_hash_num_size_N
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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,13 @@ | ||
c = (ENV['MEASURE_EXTENDED'] || 1).to_i | ||
|
||
# set env var `N` to desired Hash size to test | ||
n = (ENV['N'] || 6).to_i | ||
|
||
k = 'aaa' | ||
c.times do | ||
500_000.times do | ||
h = {} | ||
n.times { h[k] = true; h[k]; k = k.succ } | ||
h.each { |k,_| h[k] = h[k] } | ||
end | ||
end |
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,12 @@ | ||
c = (ENV['MEASURE_EXTENDED'] || 1).to_i | ||
|
||
# set env var `N` to desired Hash size to test | ||
n = (ENV['N'] || 6).to_i | ||
|
||
c.times do | ||
500_000.times do | ||
h = {} | ||
n.times { |i| h[i] = true; h[i] } | ||
h.each { |k,_| h[k] = h[k] } | ||
end | ||
end |