bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gperf-bugs] Patch to gperf 2.7.2 for case-independent keyword matc


From: Paul Jarc
Subject: Re: [Gperf-bugs] Patch to gperf 2.7.2 for case-independent keyword matching
Date: Fri, 15 Feb 2002 12:23:17 -0500
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/20.7 (i386-redhat-linux-gnu)

Bruce Lilly <address@hidden> wrote:
> Case conversion of keywords precludes storing them in a canonical
> form, e.g. "MIME-Version"

Why is that a problem?

> and additional function calls,

Counting function calls without regard to which functions are being
called and how expensive they are doesn't seem very informative.

> Moreover, both the gperf-generated case-dependent lookup
> function and the application interface are externally visible
> functions, which may result in namespace collisions or the use of
> the wrong function, and is poor programming practice (it would
> help is there were a gperf option to make the gperf-generated
> function static).

This is orthogonal to the case-comparison issue, right?

> 4. successful lookup, no hash collisions.
>    The one successful strcasecmp call is still cheaper than your
>    "recommended way" of copying and converting the string since
>    strcasecmp does no copying and requires no additional function
>    call overhead.

Lookups are typically much more common than the building of hash
tables.  The extra work you avoid happens less frequently; the extra
work you introduce happens more frequently.  It's not sufficient to
simply compare the amount of work as seen in the code; each cost
should be weighted according to the frequency of its incursion.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]