* Re: Slow byte manipulation on alpha stations ?
@ 1995-04-20 14:32 Paul E. Rockwell
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. Rockwell @ 1995-04-20 14:32 UTC (permalink / raw)
To: tru64-unix-managers
On Thu, 20 Apr 95 14:51:57 +0200 wenger@simbad.u-strasbg.fr wrote:
>
>
> Is the conclusion correct that DEC alpha processors
> are not suited for manipulating bytes ?
>
"Not suited for manipulating bytes" is perhaps a bit too strong. "You might have
to do things a bit differently to get best performance" is probably more correct.
Unlike older RISC architectures, the Alpha architecture does not contain
byte load/store instructions. To access bytes, one must load a 32-bit or
64-bit data item and mask/shift.
Why is this?? Because byte load/store instructions are too complex to implement
in hardware and make them go fast, as well as having that performance be scalable.
One of Alpha's major design goals was simplicity and speed.
However, there are things you can do to make what you have go faster:
First, if you're moving or comparing strings, use the routines included in the
standard libraries instead of manipulating pointers. These routines are hand-optimized
for the Alpha.
Second, if you insist on doing these moves yourself, remember that the memory
units that the Alpha directly manipulates is 32 or 64-bits. If you can re-code your
example to make use of that information (by aligning your character string on one
of these "natural" hardware boundaries, and then doing the moves in 32 or 64 bit
chunks) you should performance improvements.
Also, I would not directly compare the sort, awk, and grep performances. These
utilities under Digital UNIX 3.0 and later have been XPG4 internationalized and can
deal with >8 bit character sets. This may cause a performance hit compared to older,
non internationalized versions.
--------
+---------------------------+tm Paul E. Rockwell
| | | | | | | | UNIX Sales Support Consultant
| d | i | g | i | t | a | l | Digital Equipment Corporation
| | | | | | | | 500 Enterprise Drive
+---------------------------+ Rocky Hill, CT 06067
Internet: rockwell@rch.dec.com Phone: (203)258-5022
Easynet: koodie::rockwell DTN: 320-5022
^ permalink raw reply [flat|nested] 2+ messages in thread
* Slow byte manipulation on alpha stations ?
@ 1995-04-20 12:51 wenger
0 siblings, 0 replies; 2+ messages in thread
From: wenger @ 1995-04-20 12:51 UTC (permalink / raw)
To: tru64-unix-managers
Looking closely to station performances for what concerns heavy byte
manipulation applications, I found that DEC alpha stations seem to have
curious performances, compared to a SPARC 20-71 and a five years old
DEC5400 server (20 MHz Mips processor):
Compiled with cc -O2, this programme
---------------------------------------------------------
main()
{
int i;
char str1[8192], str2[8192], *p1, *p2, *pf ;
pf = str1+8192;
for (i=0; i < 10000; i++)
for (p1=str1, p2=str2; p1 < pf; )
*p1++ = *p2++;
}
---------------------------------------------------------
executed with the 'time' command, gives:
DEC 3000-400 (alpha 133 Mhz) : 18.51u 0.01s 0:18 99% 0+1k 0+0io 15pf+0w
DEC 4000-710 (alpha 190 MHz) : 12.83u 0.01s 0:17 73% 3+1k 0+0io 81pf+0w
SUN SPARC 20-71 (SuperSparc II,65 Mhz): 4.4u 0.0s 0:06 65% 0+152k 0+0io 0pf+0w
DEC 5400 server (Mips R3000, 20 MHz) : 29.1u 0.1s 0:32 90% 4+23k 0+0io 0pf+0w
when 'normally' the alpha server is twice as fast as the Sparc and about
ten times faster that the old DEC 5400.
Then I checked some standard unix utilities which manipulate bytes:
sort, awk and grep both with regular expressions.
On a file containing 50,000 lines like following ones:
--------------------------------------------------
CKLYFXGYQDYRPCLMHTXFKBDVJEANMRRIFWLTYAXVVORJHWWPFN
KYKNGYSDPLNMFYMZUEEPHUWHSROECBBKYEUNTANPWMJOANANXB
GFGQIGBOEUDZWGZJVEHTRVCPUNOSISLSFPTUVHRKDKKOYYLTNT
--------------------------------------------------
I got these results (user cpu + syst cpu)
DEC alpha DEC alpha SUN SPARC DEC
3000-400 4000-710 20-71 5400
fgrep ABCD 1.35 0.96 1.0 7.5
grep ABCD 2.77 2.16 0.9 5.1
grep grep '^AA.*ZZ$' 6.58 5.86 0.6 3.7
sort 3.08 2.38 2.7 36.2
sort +5 -6 +10r -13 +20 -30 206.04 159.33 77.1 312.6
awk '/ABCD/ {print substr($0,20,10)}' 12.40 8.42 1.2 8.9
giving on some executions better rates with a 20 MHz DEC5400 that a 190 MHz
DEC alpha station ...
Is the conclusion correct that DEC alpha processors
are not suited for manipulating bytes ?
Marc Wenger
wenger@astro.u-strasbg.fr
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-04-20 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-04-20 14:32 Slow byte manipulation on alpha stations ? Paul E. Rockwell
-- strict thread matches above, loose matches on Subject: below --
1995-04-20 12:51 wenger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox