Re: General performance [was: drawing performance]


Subject: Re: General performance [was: drawing performance]
From: Sam TH (sam@uchicago.edu)
Date: Mon Dec 18 2000 - 14:28:41 CST


On Mon, Dec 18, 2000 at 11:50:28PM +1100, Martin Sevior wrote:
>
>
> >
> > Changing the UT_stricmp to a simple strcmp causes a dramatic speedup.
> > grepping the code, this should not cause any problems since every
> > single query is currently consistanly lowercase. A simple test didn't
> > turn up any immediate problems. Should I check in the one-line change
> > to UT_stricmp to strcmp for property names?
> >
>
> This might break footer.abw which has the attribute "FOOTER" in uppercase.
> Other than that we could make this change and just fix all occurances of
> uppercase attributes/properties. After this change it will be easy enough
> to detect if someone screws up and and puts in an uppercase
> attribute/property.
>

Just going to strcmp by tiself is likely to be a problem, since there
are old .abw documents that use uppercase for attributes. However, we
ought to be able to take advantage of the short-circut or and do
something like this:

if (strcmp(propName, footer) || strcmp(propName, FOOTER))

There should be no mixed case attributes in the wild, so this
shouldn't break any non-handcrafted documents. And it would be lots
faster.

Also, strcmp can be sped up by defining it as a macro, like so (credit
to a book I was browsing a few weeks ago)

#define strcmp(s1,s2) *s1-*s2?strcmp(s1,s2):0

(macro not actually tested)
                                sam th
                                sam@uchicago.edu
                                http://www.abisource.com/~sam
                                GnuPG Key:
                                http://www.abisource.com/~sam/key




This archive was generated by hypermail 2b25 : Mon Dec 18 2000 - 14:28:43 CST