Add hash table htget benchmark.
@@ -8,15 +8,23 @@ const main = {
std.strhash("foobar")
;;
}],
- [.name="hashint", .fn={ctx;
+ [.name="hashint", .fn={ctx
for var i = 0; i < 1000; i++
std.inthash(123)
;;
}],
- [.name="hashlongstr", .fn={ctx;
+ [.name="hashlongstr", .fn={ctx
for var i = 0; i < 1000; i++
std.strhash(a)
;;
+ }],
+ [.name="htget", .fn={ctx
+ var h = std.mkht(std.strhash, std.streq)
+ std.htput(h, "foo", 123)
+ for var i = 0; i < 1000; i++
+ std.htget(h, "foo")
+ ;;
+ std.htfree(h)
}]
][:])
}
