Aaron Sloman (A.Sloman@cs.bham.ac.uk) wrote:
: I've now tried this on the Sun/solaris version of poplog also:
: solaris version 8 running on a 4cpu 450 mhz ultrasparc.
: The old version took about 5% longer than the new version.
: It's a multi-user machine, but the load was very light at the time.
: However, on an old Dell laptop, running redhat 9 on a 400 mhz
: celeron CPU, there was barely any difference in speed.
: (This may be partly due to the slow laptop disk drive causing
: other differences to be masked. The machine on which the time
: difference was most marked (1ghz athlon) also had the fastest
: disk.)
Unless you benchmarked disk IO (and many tests intended to measure
disk IO actually measure DRAM speed) the most probable explanation
is that DRAM latency in laptop in only slightly bigger then latency
in modern machine, so laptop does not feel so much slowdown from
chache mises. Also, there are instruction that are fast on Celeron
but slow on Athlon (and vice versa).
: >...
: > : Can anyone explain why invoking Waldek's C procedure should have
: > : been faster?
: >
<snip>
: The effect does not seem to be random. I averaged over several runs
: in all cases and the variance in times on each machine was not high.
: On the other hand I did use only one type of test.
: I asked a colleague about the speed difference and he offerered the
: suggestion that inline access to a variable might be compiled in a
: location-independent fashion which would make access slow compared
: with a call to a procedure at an absolute address.
I checked output of `popc -a'. The acces to `errno' is definitely
a single machine istruction. When I wrote that the effect is "random"
I mean that small change in sources can produce speed up/slow down
in unrelated parts of the program. Once the program is compiled and
linked the effect is pretty reproducible.
I do not belive that accessing errno is time-critical, after all
it is overhead on system calls (and few C library calls). System
calls always were expensive (so are not frequent) and I do not think
that Poplog is wasting 10% of execution time looking at `errno'
without any need.
--
Waldek Hebisch
hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl
|