Author: matz Date: Fri Feb 8 00:54:37 2008 New Revision: 8551 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8551&view=rev Log: _XDEBUG is often _extremely_ expensive (the << operators for e.g. solvables and the like). So guard applying the operators with a check for excessive debugging. That's nearly 25% of the runtime of "zypper in -D something". Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/b... ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/base/LogControl.cc Fri Feb 8 00:54:37 2008 @@ -214,6 +214,9 @@ struct LogControlImpl { public: + bool isExcessive() + { return _excessive; } + void excessive( bool onOff_r ) { _excessive = onOff_r; } @@ -361,6 +364,9 @@ buffer_r ); } + bool isExcessive() + { return LogControlImpl::instance.isExcessive(); } + ///////////////////////////////////////////////////////////////// } // namespace logger /////////////////////////////////////////////////////////////////// Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/b... ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/base/Logger.h Fri Feb 8 00:54:37 2008 @@ -109,6 +109,7 @@ const char * file_r, const char * func_r, const int line_r ); + extern bool isExcessive(); ///////////////////////////////////////////////////////////////// } // namespace logger Modified: branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/s... ============================================================================== --- branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h (original) +++ branches/tmp/ma/jump_sat/libzypp/zypp/solver/detail/Types.h Fri Feb 8 00:54:37 2008 @@ -35,7 +35,7 @@ #include "zypp/PoolItem.h" #define _DEBUG(x) DBG << x << std::endl; -#define _XDEBUG(x) XXX << x << std::endl; +#define _XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0) //#define _DEBUG(x) ///////////////////////////////////////////////////////////////////////// -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org