Faster hasing for `cvc5::String` (#7742)
authorAndres Noetzli <andres.noetzli@gmail.com>
Fri, 3 Dec 2021 21:36:16 +0000 (13:36 -0800)
committerGitHub <noreply@github.com>
Fri, 3 Dec 2021 21:36:16 +0000 (15:36 -0600)
commit29364b41e638c581fcbd7b152007eb95c91e0eab
treeaafc34ccecb2cad8154d0a9e65086b04f63db6a0
parent774770af22c882ade8f44aedbeed027cdf3d9496
Faster hasing for `cvc5::String` (#7742)

Previously, our hashing algorithm for cvc5::String would create an
std::string representation of the string and then call
std::hash<std::string> on the result. Creating the temporary
std::string is quite expensive and can be avoided by computing the
hash directly on the elements of the vector of characters in
cvc5::String.

This change improves our solving time on an industrial benchmark from
about 59s to 55s.
src/expr/sequence.cpp
src/util/hash.h
src/util/string.cpp
src/util/string.h