]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Added a timer for a no-load hash scan
authorrousskov <>
Tue, 31 Mar 1998 04:16:10 +0000 (04:16 +0000)
committerrousskov <>
Tue, 31 Mar 1998 04:16:10 +0000 (04:16 +0000)
src/test_cache_digest.cc

index a819e8e7d3bb7168de47e89cc81cb435e445d316..81c2d2255fd3405fdbd6cecff597649533558dee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: test_cache_digest.cc,v 1.1 1998/03/30 20:42:42 rousskov Exp $
+ * $Id: test_cache_digest.cc,v 1.2 1998/03/30 21:16:10 rousskov Exp $
  *
  * AUTHOR: Alex Rousskov
  *
@@ -140,6 +140,15 @@ cacheIndexInitDigest(CacheIndex *idx)
        idx->name,
        tvSubDsec(t_start, t_end),
        (double)1e6*tvSubDsec(t_start, t_end)/idx->count);
+    /* check how long it takes to traverse the hash */
+    gettimeofday(&t_start, NULL);
+    for (hashr = hash_first(idx->hash); hashr; hashr = hash_next(idx->hash)) {
+    }
+    gettimeofday(&t_end, NULL);
+    fprintf(stderr, "%s: hash scan took: %f sec, %f sec/M\n",
+       idx->name,
+       tvSubDsec(t_start, t_end),
+       (double)1e6*tvSubDsec(t_start, t_end)/idx->count);
 }
 
 static int