Dennis,

not quite true.... Your are right about the fetch however...

if you look at the assembler you will see

To write a byte it will read the 32bits, mask the 8 bit out, OR in the 
value required then write the 32bits back.  SO there are an extra 
two operations.

There is no point in worrying about memory in the majority of the 
programming cases anymore so you may as well use integer.


From:                   "Dennis Chuah" <[EMAIL PROTECTED]>
To:                     "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]>
Subject:                Re: [DUG] ShortInt, SmallInt
Date sent:              Wed, 15 Sep 2004 11:42:36 +1200
Send reply to:          NZ Borland Developers Group - Delphi List <[EMAIL PROTECTED]>
        <mailto:[EMAIL PROTECTED]>
        <mailto:[EMAIL PROTECTED]>

> 
> In Pentium CPU's all 8-, 16- or 32-bit operations are performed in one CPU
> cycle, so there is no performance penalty.  What you might be thinking of
> are MOV operations involving non-aligned 16- and 32-bit data.  In this case,
> the performance penalty is one CPU read or write cycle - which can vary in
> time depending on whether the data is cached or not.
> 
> ----- Original Message ----- 
> From: "Ross Levis" <[EMAIL PROTECTED]>
> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 15, 2004 11:15 AM
> Subject: Re: [DUG] ShortInt, SmallInt
> 
> 
> > Ok, what about a Char type.  Would this also need to be moved around in
> the
> > CPU.  It's basically single byte ordinal type, so I presume this would be
> > slow as well, and get slower as we get more higher bit processing CPU's.
> > 64-bit will be common soon so ideally the minimum variable size should be
> 8
> > bytes.  That's 8 times memory wastage.  But as you say, it's probably not
> > worth the worry unless there are several thousand Byte variables required.
> >
> > Cheers,
> > Ross.
> >
> > ----- Original Message ----- 
> > From: "Neven MacEwan" <[EMAIL PROTECTED]>
> > To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 15, 2004 8:10 AM
> > Subject: Re: [DUG] ShortInt, SmallInt
> >
> >
> > > Ross
> > >
> > > Its inefficient to use a byte in a 32 bit processor as it
> > > may have to shift it about to evaluate it. Its really academic in these
> > > days of megabyte memory to be concerned with 1 vs 4 bytes
> >
> > _______________________________________________
> > Delphi mailing list
> > [EMAIL PROTECTED]
> > http://ns3.123.co.nz/mailman/listinfo/delphi
> >
> _______________________________________________
> Delphi mailing list
> [EMAIL PROTECTED]
> http://ns3.123.co.nz/mailman/listinfo/delphi
> 

Regards

Rohit

======================================================================
CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
PH    (649) 489-2280 
FX    (649) 489-2290
email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
======================================================================


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to