avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] Bad programming speed on AT90S8535 using AVRdude


From: Theodore A. Roth
Subject: Re: [avrdude-dev] Bad programming speed on AT90S8535 using AVRdude
Date: Tue, 18 Nov 2003 22:33:14 -0800 (PST)

On Wed, 19 Nov 2003, Jan-Hinnerk Reichert wrote:

> On Tuesday 18 November 2003 22:35, Theodore A. Roth wrote:
> > On Tue, 18 Nov 2003, Jan-Hinnerk Reichert wrote:
> 
> > Ok. I just did some tests on my linux box.
> >
> > $ uname -a
> > Linux knuth 2.4.18-386 #2 Sun Apr 14 10:38:08 EST 2002 i686
> > GNU/Linux
> >
> > Programming a mega128 with a 32052 byte srec file with this
> > command:
> >
> >   $time ./avrdude -p atmega128 -c stk200 -e -V -v -i dlogr.srec
> >
> > latest cvs:                        21.798 s
> > with Jan-Hinnerk's patch:          22.503 s
> > same with s/1000/100/ in loop:     21.799 s
> > same with s/1000/10/:              22.213 s
> 
> Hi Ted,
> 
> perhaps a atmega128 is not the best candidate for the test ;-)))
> 
> If I'm not mistaken the code in question is _never_ hit during 
> programming a paged memory.
> 
> The delay takes place in avr_write_page() and it is just a simple:
> usleep(max_write_delay);

Ok, I've re-done my tests with a 8515. Here are the results:

Test file is 7782 bytes (attached for those interested).

latest cvs (no patches)         2m36.5 s

with Jan-Hinnerk's patch (delay in inner loop):
  (1000 us delay):              2m36.2 s
  (100 us delay):               2m36.2 s
  (1 us delay):                 2m36.3 s

Then I replaced usleep() with select():
  (2000 us delay):              1m18.6 s
  (100 us delay):               1m18.6 s
  (10 us delay):                1m18.6 s

Then with my gettimeofday() mod to Jan-Hinnerk's patch:
                                25.269 s

Using usleep() or select() causes a context switch into the os, so we are 
screwed when using those.

The gettimeofday() version hits 99+% cpu utilization. 8-)

Just for grins, I added a call to sched_yield() to the gettimeofday()  
version. Same results as gettimeofday() version.

Ready for more?

While running avrdude, I did 'make clean; time make -j4 all' of the avrdude 
source to load up the system. My load avg was just under 4 according to top.

with sched_yield() call         57.509 s
w/o sched_yield() call          43.365 s

So we take a hit when calling sched_yield().

Also, a 'make -j4' of avrdude without running avrdude, takes about 4.670 s. 
Done while running avrdude takes 6.99s s without the sched_yield() call and 
5.501 s with the call to sched_yield().

Attached is what I think should be committed. It's trivial to add the 
sched_yield() call if someone thinks that is really needed.

Ted Roth

Attachment: test.srec.bz2
Description: BZip2 compressed data

Attachment: avrdude-faster-polling.diff
Description: Text document


reply via email to

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