Reran the benchmarks using foreach/2 instead of forall/2.
With the old regular foreach/2:
Database raw and crude micro benchmark
1,000,000 entries
Database Operation Wall time
-------- --------- ---------
trie 1st lookup .......................... 0.252 secs.
rec 1st lookup .......................... 0.305 secs.
nb 1st lookup .......................... 0.772 secs.
asrt 1st lookup .......................... 0.864 secs.
consult 1st lookup .......................... 0.872 secs.
hashtable 1st lookup .......................... 1.643 secs.
trie 2nd lookup .......................... 0.251 secs.
rec 2nd lookup .......................... 0.306 secs.
asrt 2nd lookup .......................... 0.356 secs.
consult 2nd lookup .......................... 0.359 secs.
nb 2nd lookup .......................... 0.778 secs.
hashtable 2nd lookup .......................... 1.616 secs.
nb insert .......................... 0.305 secs.
trie insert .......................... 0.339 secs.
rec insert .......................... 0.410 secs.
asrt insert .......................... 0.582 secs.
hashtable insert .......................... 4.852 secs.
consult insert .......................... 21.153 secs.
With the new foreach/2:
Database raw and crude micro benchmark
1,000,000 entries
Database Operation Wall time
-------- --------- ---------
nb 1st lookup .......................... 0.406 secs.
trie 1st lookup .......................... 0.497 secs.
rec 1st lookup .......................... 0.614 secs.
consult 1st lookup .......................... 1.084 secs.
asrt 1st lookup .......................... 1.087 secs.
hashtable 1st lookup .......................... 1.612 secs.
nb 2nd lookup .......................... 0.412 secs.
trie 2nd lookup .......................... 0.503 secs.
consult 2nd lookup .......................... 0.581 secs.
asrt 2nd lookup .......................... 0.589 secs.
rec 2nd lookup .......................... 0.671 secs.
hashtable 2nd lookup .......................... 1.585 secs.
nb insert .......................... 0.586 secs.
trie insert .......................... 0.610 secs.
asrt insert .......................... 0.836 secs.
rec insert .......................... 1.059 secs.
hashtable insert .......................... 4.585 secs.
consult insert .......................... 21.302 secs.
So overall doesn’t seem to be an improvement speedwise.
EDIT: both runs were using the -O
switch.