Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
skovron
22
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 23rd Sep 2003 12:31
I'm not sure how DBP compile code into exe and I wonder if indexing arrays is more expensive than adressing fields in UDT?
Has any1 know which code run faster?

I know the difference is very small but I am still interested
OSX Using Happy Dude
22
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 23rd Sep 2003 13:25
To compile press F4
To compile and run Press F5


Quote: "Wonder if indexing arrays is more expensive than adressing fields in UDT?
Has any1 know which code run faster"

No idea - you would have to e-mail Lee for the definitive answer.


Avatar & Logo by Indi. Come to the UK DBPro Convention in Chichester
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd Sep 2003 15:09
Accessing an array is slower than accessing a UDT.

A non-array access to a UDT will either be a direct memory access, or 2 memory reads, and an addition (not sure which - I haven't looked at it).

Accessing an array item requires in total 4 memory reads, a shift left (or a multiply), and an addition. If the data you want is in a UDT there will be an extra addition for the offset within the UDT.
skovron
22
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 23rd Sep 2003 17:03
Thanks IanM. That's exacly what i wanted know

Login to post a reply

Server time is: 2026-07-25 07:01:54
Your offset time is: 2026-07-25 07:01:54