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
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 20:20

This seems to be the limit in DBP. Is there a way to make it larger?

The fastest code is the code never written.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2010 21:02
That's a 1.2GB array (DBPro does not pack UDT's tightly).

You can make it smaller by allocating an array of WORD type, and splitting out the BYTE values yourself. That would make it 600MB instead.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 21:21 Edited at: 27th Mar 2010 21:22
Quote: "That's a 1.2GB array (DBPro does not pack UDT's tightly)."
I didn't think it would be that big. Does MAKE MEMBLOCK have the same problem? My type is so simple, that I could use some simple math to get the data. That just makes it a bit more complicated.

The array should be only about 421MB.

The fastest code is the code never written.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2010 21:26
54 byte header, 2 bytes for the array data, 4 byte pointer for each array item. Ignore the 54 bytes as that has no noticable impact on size, and that is 6 bytes * 10501 * 10501 = 661626006, or approx 631 MB.

If you are happy to use a memblock, then that's going to be the most space-efficient way of doing it.

Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 21:33 Edited at: 27th Mar 2010 23:13
Is there a significant performance loss using memblocks vice an array?

EDIT:
It appears that for memblocks the limit is 1,406,402,048 bytes about 1.31GB.

The fastest code is the code never written.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2010 23:16
If you code cleanly by embedding your memblock access routines in functions, then it will be slower by around 25%. However, if you put the memblock commands directly into your code, then it will be faster than arrays by around 30%.

YMMV though, so try it yourself:


Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 27th Mar 2010 23:22
Thanks for the code. I was going to make a test similar to that, but your's does the job. So directly accessing the memblock is the way to go.

The fastest code is the code never written.

Login to post a reply

Server time is: 2026-07-26 21:12:05
Your offset time is: 2026-07-26 21:12:05