From 86c45571271358d61aa1ab23746e9cd0565cf4cb Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Fri, 7 Aug 2009 11:16:31 -0700 Subject: Kill the logging.debug function if we're not debugging, otherwise it shows up in the top 3 functions in profiling, making it mostly nop speeds things up a bit diff --git a/fusearchive.py b/fusearchive.py index 696c666..4df4116 100755 --- a/fusearchive.py +++ b/fusearchive.py @@ -44,6 +44,10 @@ def main(): # If debug is in the assembed opts then enable our debug too if server.fuse_args.assemble()[ -1 ].find( 'debug' ) != -1: log_level = logging.DEBUG + else: + # Null-out the logging.debug statement, otherwise it's a top-3 cpu + # eater in stat profiling + logging.debug = lambda x: 1 logging.basicConfig( level = log_level, format = '%(asctime)s %(levelname)s %(filename)s:%(lineno)d %(module)s:%(funcName)s() %(message)s', -- cgit v0.10.2