summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorLucas Gabriel Vuotto <lvuotto92@gmail.com>2017-11-01 16:53:26 -0300
committerOri Bernstein <ori@markovcorp.com>2017-11-14 13:50:39 -0800
commit83d26331a5419033927800760e8a59f1bd84d2b9 (patch)
treed5985e8e5a32e673f549fcaa8eb23b5335f4f74d /bench
parent8a662861ad3ded8e965ab43e5bc254dd7ee85815 (diff)
downloadmc-83d26331a5419033927800760e8a59f1bd84d2b9.tar.gz
Use new traits to implement hash tables
Signed-off-by: Lucas Gabriel Vuotto <lvuotto92@gmail.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/hashit.myr12
1 files changed, 6 insertions, 6 deletions
diff --git a/bench/hashit.myr b/bench/hashit.myr
index e06343e..8ec3b26 100644
--- a/bench/hashit.myr
+++ b/bench/hashit.myr
@@ -5,21 +5,21 @@ const main = {
testr.bench([
[.name="hashstr", .fn={ctx;
for var i = 0; i < 1000; i++
- std.strhash("foobar")
+ std.hash("foobar")
;;
}],
[.name="hashint", .fn={ctx
for var i = 0; i < 1000; i++
- std.inthash(123)
+ std.hash(123)
;;
}],
[.name="hashlongstr", .fn={ctx
for var i = 0; i < 1000; i++
- std.strhash(a)
+ std.hash(a)
;;
}],
[.name="htget", .fn={ctx
- var h = std.mkht(std.strhash, std.streq)
+ var h = std.mkht()
std.htput(h, "foo", 123)
for var i = 0; i < 1000; i++
std.htget(h, "foo")
@@ -27,14 +27,14 @@ const main = {
std.htfree(h)
}],
[.name="htput", .fn={ctx
- var h = std.mkht(std.strhash, std.streq)
+ var h = std.mkht()
for var i = 0; i < 1000; i++
std.htput(h, "foo", 123)
;;
std.htfree(h)
}],
[.name="htputmany", .fn={ctx
- var h = std.mkht(std.inthash, std.inteq)
+ var h = std.mkht()
for var i = 0; i < 1000; i++
std.htput(h, i, 123)
;;