[fpc-pascal]Execution speed

Lee, John John.Lee at logicacmg.com
Fri Jan 24 17:11:58 CET 2003

Goes w/o saying that program perf depends on many things, but typically if
one runs a processor intensive (no i/o) benchmark eg an fft (fp) or a large
integer calculation on processors of different speeds the time is about
proportional to the proc speed and possibly the memory speed (a bit) if the
program/data in the loop is larger than the cache size for a given
processor. The AMD & pII are somewhat different in the way they work
internally but the factor would still be around the ration of the clock
speeds. I've done this with fpc code on PCs from 100M- 1G+ & it works, it
doesn't depend to any significant extent on the o/s.  

It looks as if there is more tinme spend in disk io than you think (assuming
that there are no sleeps or other time waits within the program), and that
will clearly limit the speed improvement since the disks are probably not n
times faster on the later PC, probably only 1-2 times?. Remember that any
call to an i/o procedure eg as read/write statement may result in one or
more o/s calls and disk i/o as well as many millions of lines of code & this
could take many many milliseconds eg a disk seek is usually 2msec, a read
write can be 10s of msec, compared with the the time taken by a x:=x+23; or
y:=cos(x); or whatever type lines which may only take a few 100 nsecs or
cedrtainly < a microsec on a 1.6G processor   
My suggestion is that you do some more timing of the code. I use clock, &
put lots of timing statemenmts in (with some sort of test flag or compiler
conditional) which gives microsec accuracy from Tomas Schatzl's cpu unit,
for checking this sort of thing, or you can probably use profil? to show
where program spends most of it's time.    

NB it 100% certainly isn't BIOS or win se! 


Regards John

-----Original Message-----
From: Mark Emerson [mailto:ChiefAngel at angelbase.com]
Sent: Friday, January 24, 2003 15:39
To: fpc-post
Subject: [fpc-pascal]Execution speed

Now that the list seems to be working again...I'll try posting this again:

I am wondering why our new PC is not executing our fpc-compiled program
very much faster than the old one. It was really quite a disappointment:

Old PC: Laptop, Intel PII, 300 MHz, 64 MB. Execution times: 8:30, 2:30

New PC: Desktop, AMD Duron, 1.6 GHz, 128 MB. Execution times: 5:15, 1:15

The new PC ought to be 5 times faster (1600 MHz / 300 MHz, right? Of
course the speed of the memory is also a factor) but it's not even twice
as fast.

The execution time pairs are determined from three time stamps that
occur during one run of the program. The sequence is as follows:

* Stamp 1
-Initialize (5-10 secs reading/processing from HD)
-Process 1 (5-9 mins)
* Stamp 2
-Process 2 (1-3 mins)
* Stamp 3

Both machines are running Win98 Second Edition (could Windows 98 be
preventing the faster machine from running at full capacity? Or perhaps
it's because fpc runs in a DOS window, and the DOS mode is forcing it to
run slow?)

The program is very processor intensive. Only about 4MB of memory space
is used.

During runtime, we are doing less than 400 kb of read/write combined to
the HD. We put about 10 lines of text on the DOS screen to show
progress. So I can't imagine the I/O could be slowing us down.

I tried compiling with the two different target platforms, but it didn't
make a difference. Stackchecking is on, but it was on on both computers.

I also tried a few different bios settings (the computer has ready-made
bios configurations for "Optimal" and "Best Performance" (?) as well as
the factory default I started with.) But the compile times were the same
regardless of the bios settings.

Any thoughts?

fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.

More information about the fpc-pascal mailing list