TIP: Click on subject to list as thread! ANSI
echo: delphi
to: FRANCOIS PIETTE
from: JUD MCCRANIE
date: 1997-08-01 00:29:00
subject: RE: CARDINAL

> JM> speed. On a Pentium Pro, however, 32-bit may be faster than 16-bit.To
> JM> sum up, there is no speed penalty for using 32-bit integers instead of
> JM> 16-bit integers with a 32-bit compiler.
 FP> Ypu forget to mention that the 32 bit integer need to be read or
 FP> writtent to/from memory. Doubling the width could double the memory 
 FP> bandwidth needed.
I didn't mention it, but I didn't forget it.  All PC CPUs from
the 386DX and higher have 32-bit access to memory.  So they can
get 32-bit quantities from/to memory as easily as 16-bit ones
(perhaps easier).
 FP> Also, note that reading or writing a 32 bit
 FP> quantity can be slowed down if the quantity is not well aligned in 
 FP> memory. The processor must in some cases perform TWO memory accesses. 
 FP> The speed penalty can be quite large !
You're right, that can be a factor.  I always use the ALIGN
option, but TP/BP 7 seems to align on 2-byte boundaries, not
4-bytes.  However, there are other compilers that are guaranteed
to align on 4-byte boundaries.  In particular, remember that we
were talking about CARDINAL type in DELPHI 3.  I don't know if
Cardinal exists in D1, but D2 and D3 are 32-bit compilers that
are guaranteed to align cardinals properly (see 18-7 of the D3
Object Pascal Language guide).
And if you read the part of my message quoted at the top, I was
talking about 32-bit compilers, Delphiu 2 and 3 in particular.
And any decent 32-bit compiler on a 386DX, 486, or Pentium will
align 32-bit cardinals/integers properly.
Jud McCranie
... The ease of Pascal with the power of Pascal.
 * Silver Xpress V4.3 SW20178
--- PCBoard (R) v15.3/M 5
---------------
* Origin: Riverdale, Ga (1:133/9024)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.