Re: const functions

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 23 Oct 2001 09:17:07 +0200

Alex Rousskov wrote:

> I can think of a few reasons to avoid the hack.
>
> 0. It has a double underscore
> 1. It looks ugly

0, 1 is not valid reasons. These facts will be hidden by a define of our
choice to guarantee protability to other compilers than GNU C.

> 2. It is highly unlikely to provide any measurable performance
> improvement for Squid in the foreseeable future

agreed.

> 3. The function that qualifies now may not qualify tomorrow, but
> the compiler will continue to over-optimize it, producing
> hard-to-find bugs
> 4. We may think that a function qualifies, but it
> does not (same side-effects as in 3)

3 and 4 is what is making me worried.

> 5. Technically, it is compiler's work to find these functions
> automatically.

agreed, but in this specific case a C compiler requires some help as it
has no memory cross file boundaries.

Defentiely not a high priority thing, and certainly not a 2.5 candidate.

If profiling finds that one such function is among the top 150 then we
can consider it, but more likely the design of the calling code segment
is what really needs to be optimized.

Regards
Henrik
Received on Tue Oct 23 2001 - 02:05:12 MDT

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