Startup and shutdown improvements. Performance improvements.

This commit is contained in:
JoelKatz
2013-03-03 02:09:19 -08:00
parent 0015716cb5
commit 51a85504a8
7 changed files with 70 additions and 10 deletions

View File

@@ -23,8 +23,12 @@ DECLARE_INSTANCE(SHAMapTreeNode);
void SHAMapNode::setHash() const
{
std::size_t h = theApp->getNonceST() + mDepth;
mHash = mNodeID.hash_combine(h);
std::size_t h = theApp->getNonceST() + (mDepth * 0x9e3779b9);
const unsigned int *ptr = reinterpret_cast<const unsigned int *>(mNodeID.begin());
for (int i = (mDepth + 3) / 4; i >= 0; --i)
boost::hash_combine(h, *ptr++);
mHash = h;
}
std::size_t hash_value(const SHAMapNode& mn)