[Top][All Lists]

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

Re: [avr-libc-dev] bsearch() speed optimization. Opinions?

From: E. Weddington
Subject: Re: [avr-libc-dev] bsearch() speed optimization. Opinions?
Date: Mon, 31 Jan 2005 07:43:24 -0700
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

Dmitry K. wrote:

Hi all.

Now bsearch function uses multiplication to everyone itteration. This
operation can be excluded from a body of a cycle. I have tried to make
it. In result speed of search considerably increase (for classic avr-s),
but also the size of a code too has increased.

Certainly, it is possible to include a new variant only for classic
chips under condition of absence of a key `-Os', but I doubt, that such
combination for anybody can be useful.


Comparison old and new 'bsearch' is below resulted:

Search in 100-bytes array of chars (result was at first element).

avr2            3.3.5   3.3.5   3.4.3   3.4.3   4.0     4.0
~~~~            -Os rr  -O3     -Os rr  -O3     -Os rr  -O3

1.2.0   size:   78+12   86+14   77+12   89+14   77+12   92+14
       cls:    806     815     813     821     808     829

20050129 size:  93+14   93+14   83+12   106+14  89+12   106+14
        cls:   670     551     533     546     554     545

My only concern is that most users seem to complain about code *size* and not code *speed* especially as it concerns avr-libc functions. I wouldn't necessarily feel comfortable about having different versions that are built for different devices.

But, I also think that what you've been able to do is great! If there was any way to keep the size closer to the same it would be a win.

But, my objections are not strong either. If others think this would be better to put in, I wouldn't have problems with it.

Any other opinions?


reply via email to

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