diff -ur squid-ntlm/acconfig.h squid-ntlm-max_debug_level/acconfig.h
--- squid-ntlm/acconfig.h	Mon Aug 20 16:06:56 2001
+++ squid-ntlm-max_debug_level/acconfig.h	Wed Aug 29 08:34:43 2001
@@ -28,6 +28,10 @@
 /*********************************
  * START OF CONFIGURABLE OPTIONS *
  *********************************/
+
+/* Max-debug-level configuration */
+#undef MAX_DEBUG_LEVEL
+
 /*
  * If you are upset that the cachemgr.cgi form comes up with the hostname
  * field blank, then define this to getfullhostname()
diff -ur squid-ntlm/configure.in squid-ntlm-max_debug_level/configure.in
--- squid-ntlm/configure.in	Fri Jul 20 15:28:21 2001
+++ squid-ntlm-max_debug_level/configure.in	Wed Aug 29 08:34:43 2001
@@ -235,6 +235,15 @@
   fi
 ])
 
+AC_ARG_WITH(max-debug-level,
+[  --with-max-debug-level=num
+                           Limit the available debug-levels to those
+                           lower than num, marginally improving performance],
+[$squid_cv_max_debug_level=${withval}])
+if test "x$squid_cv_max_debug_level" != "x"; then
+	AC_DEFINE_UNQUOTED(MAX_DEBUG_LEVEL,$squid_cv_max_debug_level)
+fi
+
 AC_ARG_ENABLE(carp,
 [  --enable-carp           Enable CARP support],
 [ if test "$enableval" = "yes" ; then
diff -ur squid-ntlm/include/autoconf.h.in squid-ntlm-max_debug_level/include/autoconf.h.in
--- squid-ntlm/include/autoconf.h.in	Fri Jul 20 15:34:18 2001
+++ squid-ntlm-max_debug_level/include/autoconf.h.in	Wed Aug 29 08:34:43 2001
@@ -68,9 +68,9 @@
    byte first (like Motorola and SPARC, unlike Intel and VAX).  */
 #undef WORDS_BIGENDIAN
 
-/*********************************
- * START OF CONFIGURABLE OPTIONS *
- *********************************/
+/* Max-debug-level configuration */
+#undef MAX_DEBUG_LEVEL
+
 /*
  * If you are upset that the cachemgr.cgi form comes up with the hostname
  * field blank, then define this to getfullhostname()
diff -ur squid-ntlm/src/defines.h squid-ntlm-max_debug_level/src/defines.h
--- squid-ntlm/src/defines.h	Mon Aug 20 16:06:58 2001
+++ squid-ntlm-max_debug_level/src/defines.h	Wed Aug 29 08:37:31 2001
@@ -72,8 +72,14 @@
 #define COMM_NOCLOEXEC		0x02
 #define COMM_REUSEADDR		0x04
 
+#ifdef MAX_DEBUG_LEVEL
+#define debug(SECTION, LEVEL) \
+        (MAX_DEBUG_LEVEL > (LEVEL) && (_db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : _db_print
+#else
 #define debug(SECTION, LEVEL) \
         ((_db_level = (LEVEL)) > debugLevels[SECTION]) ? (void) 0 : _db_print
+#endif
+
 
 #define safe_free(x)	if (x) { xxfree(x); x = NULL; }