Page 1 of 1

Table VS Memory Access

Posted: Sun Feb 27, 2011 10:10 pm
by ArtBlink
Hello,

I have problem, i have make a memory access speed test and i see this:

Memory acess with Peek an Poke command are slower than table command.

The speedest technique to write information is Table[number]=data

What is the utility of memory block function? because table technique is more fast and read global variable too :shock:

Some command are useless like Div(), Mul() etc...

X=Mul(2,10) is slower than X=2*10

So why do you keep these command? if you erase these command, we win in size of compiled prg and in readability, because 2 command to make the same things... keep as much faster for programm faster ;-)

Re: Table VS Memory Access

Posted: Mon Feb 28, 2011 11:19 pm
by airsoftsoftwair
ArtBlink wrote:Hello,
What is the utility of memory block function? because table technique is more fast and read global variable too :shock:
Memory block functions do not consume as much memory as tables because the memory block is stored as one contiguous chunk. Tables on the other hand are scattered all over the place.

Also, memory block functions can come in handy when dealing with raw data in memory. Often needed for debugging stuff.
Some command are useless like DIV(), Mul() etc...

X=Mul(2,10) is slower than X=2*10

So why do you keep these command? if you erase these command, we win in size of compiled prg and in readability, because 2 command to make the same things... keep as much faster for programm faster ;-)
These are kept for compatibility reasons. Removing them wouldn't make the program any smaller because these functions really only have a few lines of code :)

Re: Table VS Memory Access

Posted: Tue Mar 01, 2011 8:36 am
by ArtBlink
Ok ;-)

But i don't understand why access table like command table[index]=[data] is much faster than Peek/Poke/call !!!!

We indicated the size of memory, but we can indicate the type of memory like GFX memory or Fast memory?

Re: Table VS Memory Access

Posted: Thu Mar 03, 2011 10:17 am
by airsoftsoftwair
Peek() and Poke() are slower because these are function calls whereas table accessing is directly done by the VM.

Chip or fast memory allocation is not supported by the memory block functions because this is not needed by Hollywood.