This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Description
Tried a better hash:
#define HASH_COMBINE(hash, ty, v) hash * 31 + std::hash<ty>()(v)
for (unsigned i = 0; i < key.num_ops; ++i) {
hash = HASH_COMBINE(hash, uint16_t, key.ops[i].id);
for (auto &arg : key.ops[i].args) {
if (auto *v = get_if<int64_t>(&arg)) {
hash = HASH_COMBINE(hash, int64_t, *v);
} else if (auto *v = get_if<vector<long>>(&arg)) {
for (auto n : *v) {
hash = HASH_COMBINE(hash, long, n);
}
}
}
}
#undef HASH_COMBINE
Reduced collisions to almost zero, but zero perf difference.