From: axp@amazing.ch (Christoph Dworzak)
To: axp-list@redhat.com
Subject: rpcc
Date: Tue, 12 Jan 1999 03:55:00 GMT [thread overview]
Message-ID: <278e88a7.u10t12e.df8c-axp@amazing.ch> (raw)
Hi
With some help from this list, I'm getting better
with axp-asm :)
Now my next question is, how do I measure the speed
of my code?
My test looks like this:
--------------------------------------------------------
unsigned long c1, c2, ccm=~0UL, ccs=0, n;
for (n=0; n<(1UL<<19); n++){
asm volatile("rpcc %0" : "=r"(c1) : : "memory");
core();
asm volatile("rpcc %0" : "=r"(c2) : : "memory");
c1 = (c1 + (c1<<32)) >> 32;
c2 = (c2 + (c2<<32)) >> 32;
c2 = (c2>c1) ? c2-c1 : c2+(1UL<<32)-c1;
ccs += c2;
if (c2<ccm) ccm = c2;
}
printf("\nMin=%ld Avg=%ld\n\n", ccm, ccs/n;
--------------------------------------------------------
When I run this several times, I get strange results
(see end of my mail)
Why does it take up to 50% longer sometimes? (it really
does, checking with my wrist-watch.)
Of course I know, there are some task-switches or interupts,
but I would expect, that at least one loop out of one million
runs uninteruptet on full speed...
Has it something to do with alignment of the code in memory
and if so, how could I place the code so it runs at full speed?
Bye
dworz
--------------------------------------------------------
[dworz@really speed]# time ./speedtest
Min=6063 Avg=6552
13.85user 0.00system 0:15.11elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=6065 Avg=6546
13.84user 0.00system 0:15.54elapsed 89%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=7961 Avg=8975
18.93user 0.00system 0:20.66elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=6063 Avg=6532
13.80user 0.00system 0:15.52elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=7975 Avg=8970
18.92user 0.00system 0:20.66elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=6062 Avg=6477
13.69user 0.00system 0:14.96elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
[dworz@really speed]# time ./speedtest
Min=6063 Avg=6520
13.78user 0.00system 0:15.06elapsed 91%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (69major+14minor)pagefaults 0swaps
--------------------------------------------------------
next reply other threads:[~1999-01-12 3:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-12 3:55 Christoph Dworzak [this message]
1999-01-12 3:20 ` rpcc Peter Petrakis
1999-01-12 4:59 ` rpcc Richard Henderson
[not found] ` <rth@twiddle.net>
1999-01-12 16:59 ` rpcc Christoph Dworzak
1999-01-12 19:27 ` rpcc Richard Henderson
1999-01-12 21:06 ` rpcc Wes Bauske
1999-01-13 2:16 ` rpcc Richard Henderson
1999-01-14 16:17 ` Alpha 21264 Christoph Dworzak
1999-01-14 15:46 ` Greg Lindahl
1999-01-14 17:27 ` Richard Henderson
1999-10-24 15:04 ` patch_v2: (on Alpha) emulating missing instructions Christoph Dworzak
1999-10-25 9:47 ` Phil Carmody
-- strict thread matches above, loose matches on Subject: below --
1999-01-13 14:10 Alpha 21264 Andy Almond
1999-01-13 16:36 ` Jeff Sturm
1999-01-14 6:50 ` Richard Henderson
1999-10-18 14:46 patch_v2: (on Alpha) emulating missing instructions Robert Harley
1999-10-18 15:31 ` Phil Carmody
1999-10-23 20:39 ` Richard Henderson
1999-10-21 16:23 ` patch_v3: emulating missing instructions on Alpha Luke Deller
1999-10-23 20:55 ` Richard Henderson
1999-10-24 0:28 ` Daniel Potts
1999-10-25 1:22 ` Luke Deller
1999-10-28 23:34 ` Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox