the ++ operator
V13
v13 at priest.com
Sun Nov 23 21:00:38 EET 2003
On Saturday 22 November 2003 14:36, Manolis Stamatogiannakis wrote:
> To "register" pantws, apotelei hint ston compiler. An o compiler nomizei
> pws tou 'perisevoun' registers, 8a afierwsei ena register gia na krataei
> thn timh tou p. Alloiwtika to p 8a meinei aplh metavlhth kai h taxythta 8a
> meinei h idia.
To register einai praktika axristo.. to mono poy paizei pleon rolo kato apo
K.S. einai to volatile... Opoiadipote metabliti den einai volatile ginetai
amesos ypopsifia gia register symfona me ta kritiria toy compiler ta opoia
sto 100% ton periptoseon exoyn idia h kalyterh apodosi apo ayta toy
programmatisth...
> Pantws Tom an 3ekinas na kaneis to programma sou grhgorotero kanontas
> optimize to i++, mallon xaneis ton kairo sou. To i++ 8a einai to teleutaio
> pragma pou 8a ginei optimize. Mesa ston kwdika sou/mou/tou yparxoun
> sigoura poly xeirotera pragmata pou ta pairnoume oloi apshfista. P.x.
Otan exeis 4-5 loop to ena mesa sto allo kai to endiameso ekteleitai 1 myrio
fores kethe ligo kai ligaki tote akoma kai to 1hz metraei (p.x. skaki)...
Ayto bebaia stis meres mas einai to teleytaio mias kai to problima einai
kirios me tin mnimi kai thn cache... Mia kalh sxediash toy programmatos kai
ton domon toy oste na ekmetaleyetai thn CPU cache tha ferei poly megalytera
apotelesmata apo to petsokoma toy kodika...
> Epishs, oso pio aplo einai ena mh-optimized kommati kwdika, toso pio
> eukolo einai gia ton compiler na to kanei optimize. Etsi to i++ mallon 8a
> to kanei optimize o compiler oso kalytera ginetai, ane3arthta me to pws 8a
> to grapseis esy. To loop pou anefera omws, de nomizw na to peira3ei kaneis
> compiler.
To na exeis enan pinaka global kai na xrhsimopoieis ayton fernei beltiosh h
opoia den eksartatai apo ton compiler kai den mporei na epiteyxthei me allo
tropo...
> M.
<<V13>>
More information about the Linux-greek-users
mailing list