summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-10 01:06:27 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-10 01:07:53 -0700
commit16b5ec849c2886329338f210cb4c90efc26c8b38 (patch)
tree5007ee12988aacc2ca719cd0ec4ac8378670b47b
parentbefeeb302c131fc318430bbdcdff2a5d3d18c6d0 (diff)
downloadmc-16b5ec849c2886329338f210cb4c90efc26c8b38.tar.gz
Add a hash table put benchmark.
-rw-r--r--bench/hashit.myr9
1 files changed, 8 insertions, 1 deletions
diff --git a/bench/hashit.myr b/bench/hashit.myr
index fbf4011..31a0cbd 100644
--- a/bench/hashit.myr
+++ b/bench/hashit.myr
@@ -25,7 +25,14 @@ const main = {
std.htget(h, "foo")
;;
std.htfree(h)
- }]
+ }],
+ [.name="htput", .fn={ctx
+ var h = std.mkht(std.strhash, std.streq)
+ for var i = 0; i < 1000; i++
+ std.htput(h, "foo", 123)
+ ;;
+ std.htfree(h)
+ }],
][:])
}