3 ms·
Yeah, I found hundreds surprising (although not on reflection).
by zellyn 2mo ago
Yeah, I found hundreds surprising (although not on reflection).
- __s 2mo agoDepends on comparison function. In clickhouse-c for type name lookup it's strcmp so I use generated hash table with no collisions & reusing cityhash function since we have it handy: https://github.com/ClickHouse/clickhouse-c/blob/4bdd89a02438d1e81ba7cf95dc111af8a23e313b/clickhouse.h#L1234 https://github.com/ClickHouse/clickhouse-c/blob/4bdd89a02438... Benchmarked an order of magnitude faster than linear scan or binary search. I agree with your general sentiment tho, which is why I measured