perf: use lean::unordered_set for expr_eq_fn (#11731)

This PR makes the cache in expr_eq_fn use mimalloc for a small
performance win across the board.
This commit is contained in:
Henrik Böving 2025-12-18 15:24:50 +01:00 committed by GitHub
parent eb11ccb234
commit 34d619bf93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,7 @@ Author: Leonardo de Moura
#include "runtime/thread.h"
#include "kernel/expr.h"
#include "kernel/expr_sets.h"
#include "util/alloc.h"
namespace lean {
/**
@ -26,7 +27,7 @@ class expr_eq_fn {
return hash((size_t)p.first >> 3, (size_t)p.second >> 3);
}
};
typedef std::unordered_set<std::pair<lean_object *, lean_object *>, key_hasher> cache;
typedef lean::unordered_set<std::pair<lean_object *, lean_object *>, key_hasher> cache;
cache * m_cache = nullptr;
size_t m_max_stack_depth = 0;
size_t m_counter = 0;