Re: Debug levels

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 27 Aug 2001 21:57:57 +0200

"Chemolli Francesco (USI)" wrote:

> In unrelated news, I'm beginning to mumble about dirty CPP tricks which
> would
> allow to specify a maximum compiled-in debug level, saving CPU
> clicks by not performing many debug level comparisions.
> Do you think such an hack would be useful?

Only maginally I think. The debug() maco is very short as it is, doing a
static compare which in most cases shold be evaluated very early in the
CPU pipeline. But on the other hand it is used fairly frequently so it
probably adds up to something.

Adding an option to eleminate the most detailed debug outputs should be
fairly easy. Simply have the macro expand into a condition including the
limit and the compiler should optimize away the whole statement.

--
Henrik
Received on Mon Aug 27 2001 - 14:00:15 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:16 MST