| Index: third_party/WebKit/Source/wtf/HashTable.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/HashTable.cpp b/third_party/WebKit/Source/wtf/HashTable.cpp
|
| index 1b5eed23dc29a6215b506498e253a903ecd2d970..03becaef6eaee197324a20b53e14cc8f43524b50 100644
|
| --- a/third_party/WebKit/Source/wtf/HashTable.cpp
|
| +++ b/third_party/WebKit/Source/wtf/HashTable.cpp
|
| @@ -33,36 +33,39 @@ int HashTableStats::numRehashes;
|
| int HashTableStats::numRemoves;
|
| int HashTableStats::numReinserts;
|
|
|
| -static Mutex& hashTableStatsMutex()
|
| -{
|
| - DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex);
|
| - return mutex;
|
| +static Mutex& hashTableStatsMutex() {
|
| + DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex);
|
| + return mutex;
|
| }
|
|
|
| -void HashTableStats::recordCollisionAtCount(int count)
|
| -{
|
| - MutexLocker lock(hashTableStatsMutex());
|
| - if (count > maxCollisions)
|
| - maxCollisions = count;
|
| - numCollisions++;
|
| - collisionGraph[count]++;
|
| +void HashTableStats::recordCollisionAtCount(int count) {
|
| + MutexLocker lock(hashTableStatsMutex());
|
| + if (count > maxCollisions)
|
| + maxCollisions = count;
|
| + numCollisions++;
|
| + collisionGraph[count]++;
|
| }
|
|
|
| -void HashTableStats::dumpStats()
|
| -{
|
| - MutexLocker lock(hashTableStatsMutex());
|
| +void HashTableStats::dumpStats() {
|
| + MutexLocker lock(hashTableStatsMutex());
|
|
|
| - dataLogF("\nWTF::HashTable statistics\n\n");
|
| - dataLogF("%d accesses\n", numAccesses);
|
| - dataLogF("%d total collisions, average %.2f probes per access\n", numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses);
|
| - dataLogF("longest collision chain: %d\n", maxCollisions);
|
| - for (int i = 1; i <= maxCollisions; i++) {
|
| - dataLogF(" %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this many or more)\n", collisionGraph[i], i, 100.0 * (collisionGraph[i] - collisionGraph[i+1]) / numAccesses, 100.0 * collisionGraph[i] / numAccesses);
|
| - }
|
| - dataLogF("%d rehashes\n", numRehashes);
|
| - dataLogF("%d reinserts\n", numReinserts);
|
| + dataLogF("\nWTF::HashTable statistics\n\n");
|
| + dataLogF("%d accesses\n", numAccesses);
|
| + dataLogF("%d total collisions, average %.2f probes per access\n",
|
| + numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses);
|
| + dataLogF("longest collision chain: %d\n", maxCollisions);
|
| + for (int i = 1; i <= maxCollisions; i++) {
|
| + dataLogF(
|
| + " %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this "
|
| + "many or more)\n",
|
| + collisionGraph[i], i,
|
| + 100.0 * (collisionGraph[i] - collisionGraph[i + 1]) / numAccesses,
|
| + 100.0 * collisionGraph[i] / numAccesses);
|
| + }
|
| + dataLogF("%d rehashes\n", numRehashes);
|
| + dataLogF("%d reinserts\n", numReinserts);
|
| }
|
|
|
| #endif
|
|
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|