summaryrefslogtreecommitdiff
path: root/upb_table.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-06-15 09:07:12 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-06-15 09:07:12 -0700
commit5ec762a6006959a9ef37b4e7855702d621481b2f (patch)
tree1f1d85f5bbea65e1f1d001358538ad1134b86ae5 /upb_table.h
parentf4c00fc9798d5089f7d22054a45f645cd1a0936c (diff)
Added TODO about experimenting with Cuckoo Hashing.
Diffstat (limited to 'upb_table.h')
-rw-r--r--upb_table.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/upb_table.h b/upb_table.h
index 41cc2f7..5a23ae5 100644
--- a/upb_table.h
+++ b/upb_table.h
@@ -64,6 +64,11 @@ inline struct upb_inttable_entry *upb_inttable_mainpos(
inline void *upb_inttable_lookup(struct upb_inttable *table,
int32_t key,
int32_t entry_size) {
+ /* TODO: experiment with Cuckoo Hashing, which can perform lookups without
+ * any branches, cf:
+ * http://www.cs.cmu.edu/~damon2006/pdf/zukowski06archconscioushashing.pdf.
+ * The tradeoff is having to calculate a second hash for every lookup, which
+ * will hurt the simple array case. */
struct upb_inttable_entry *e = upb_inttable_mainpos2(table, key, entry_size);
do {
if (key == e->key) return e;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback