--------------------- PatchSet 2522 Date: 2001/06/13 09:10:19 Author: akroonmaa Branch: akroonmaa-head Tag: (none) Log: try to probe MD5 overhead Members: include/profiling.h:1.1.6.3->1.1.6.4 src/store_key_md5.c:1.5.28.1->1.5.28.2 Index: squid/include/profiling.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/profiling.h,v retrieving revision 1.1.6.3 retrieving revision 1.1.6.4 diff -u -r1.1.6.3 -r1.1.6.4 --- squid/include/profiling.h 9 May 2001 22:43:24 -0000 1.1.6.3 +++ squid/include/profiling.h 13 Jun 2001 09:10:19 -0000 1.1.6.4 @@ -83,6 +83,9 @@ XPROF_file_read, XPROF_file_write, XPROF_file_close, + XPROF_storeKeyPrivate, + XPROF_storeKeyPublic, + XPROF_storeKeyPubByReq, XPROF_LAST } xprof_type; Index: squid/src/store_key_md5.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_key_md5.c,v retrieving revision 1.5.28.1 retrieving revision 1.5.28.2 diff -u -r1.5.28.1 -r1.5.28.2 --- squid/src/store_key_md5.c 18 Apr 2001 18:35:33 -0000 1.5.28.1 +++ squid/src/store_key_md5.c 13 Jun 2001 09:10:19 -0000 1.5.28.2 @@ -1,6 +1,6 @@ /* - * $Id: store_key_md5.c,v 1.5.28.1 2001/04/18 18:35:33 akroonmaa Exp $ + * $Id: store_key_md5.c,v 1.5.28.2 2001/06/13 09:10:19 akroonmaa Exp $ * * DEBUG: section 20 Storage Manager MD5 Cache Keys * AUTHOR: Duane Wessels @@ -99,11 +99,13 @@ assert(id > 0); debug(20, 3) ("storeKeyPrivate: %s %s\n", RequestMethodStr[method], url); + PROF_start(storeKeyPrivate); MD5Init(&M); MD5Update(&M, (unsigned char *) &id, sizeof(id)); MD5Update(&M, (unsigned char *) &method, sizeof(method)); MD5Update(&M, (unsigned char *) url, strlen(url)); MD5Final(digest, &M); + PROF_stop(storeKeyPrivate); return digest; } @@ -113,10 +115,12 @@ static cache_key digest[MD5_DIGEST_CHARS]; unsigned char m = (unsigned char) method; MD5_CTX M; + PROF_start(storeKeyPublic); MD5Init(&M); MD5Update(&M, &m, sizeof(m)); MD5Update(&M, (unsigned char *) url, strlen(url)); MD5Final(digest, &M); + PROF_stop(storeKeyPublic); return digest; } @@ -133,12 +137,14 @@ unsigned char m = (unsigned char) method; const char *url = urlCanonical(request); MD5_CTX M; + PROF_start(storeKeyPubByReq); MD5Init(&M); MD5Update(&M, &m, sizeof(m)); MD5Update(&M, (unsigned char *) url, strlen(url)); if (request->vary_headers) MD5Update(&M, (unsigned char *) request->vary_headers, strlen(request->vary_headers)); MD5Final(digest, &M); + PROF_stop(storeKeyPubByReq); return digest; }