a significant portion of the codebase relies on copying shared_ptr<T>. most importantly, shared_ptr<T> is how variables and constraints are stored in cw_csp, and those pointers are also used as hashmap keys, and stored by value in word_domain and in cw_csp.ac3()
as it turns out, copying shared_ptr<T> is incredibly expensive due to also copying the atomic use count, and execution can probably be sped up tremendously if this copying were removed
to do this, a) use references when possible instead of copies, like in word_domain, and b) probably create some unique one-to-one mapping table between shared_ptr<T> and a primitive like uint to use throughout cw_csp
shared_ptr<T>
. most importantly,shared_ptr<T>
is how variables and constraints are stored incw_csp
, and those pointers are also used as hashmap keys, and stored by value inword_domain
and incw_csp.ac3()
shared_ptr<T>
is incredibly expensive due to also copying the atomic use count, and execution can probably be sped up tremendously if this copying were removedword_domain
, and b) probably create some unique one-to-one mapping table betweenshared_ptr<T>
and a primitive likeuint
to use throughoutcw_csp