maemre / cadmium

1 stars 0 forks source link

Intern/hash-cons atoms #13

Open maemre opened 5 years ago

maemre commented 5 years ago

We are not doing any hash consing/interning for atoms. It is an important optimization. We already have a typedef for atoms so we can replace it with an interned string implementation to handle this in most of the places. We need to implement the Hash, PartialEq, PartialOrd traits for atoms ourselves rather than deriving them to make them efficient.

We also need to switch to atoms in a couple of places that we use strings to get the full benefit (e.g. predicate names).