@Native Tech - Something sounds very wrong there. Wordspionage uses data files to store up to 30 active games. Files get up to ~120kb and don't take anywhere near 20 seconds to open the file, read the bytes, xor them, and set the bytes to memblocks, they aren't all bytes though, many are integers so maybe that's the issue, but even then...
So I'm terribly curious. Can you start a new thread so we can discuss outside of this? Maybe there's some optimization we can assist you with.
EDIT
Just ran a basic test on on Windows 7 - mid-high end machine
memblock size = 100,000,000 bytes (95.3MB)
make memblock time (fill with random bytes) = 13.07 sec
write block to file = 18.69 sec
clear memblock time (set to all 0) = 10.0 sec
load file into memblock time = 29.13 sec
So that's 95.3MB / 29.13 sec = 3.27 MB/s
Just for S&G I copied the file from my one HDD to another (both are somewhat fast) and it copied at 3.8MB/s
I'd say AGK's doing a pretty fine job and is really just slowed by the disk speed. I'm sure on Android or iOS it is a bit slower. If I have time I'll test, but here's my code:
+ Code SnippetSetPrintSize(2)
//kilobyte
memblockSize = 1024
//megabyte
memblockSize = 1024 * 1024
//max size
memblockSize = 100000000
myMemblock = CreateMemblock(memblockSize)
//fill memblock
t# = timer()
for i = 1 to memblockSize
SetMemblockByte(myMemblock , i - 1 , random(0,255))
next i
t1# = timer()
t_makememblock# = t1# - t#
//write to file
fileID = OpenToWrite("memblockdump.dat" , 0)
for i = 1 to memblockSize
b = GetMemblockByte(myMemblock , i - 1)
WriteByte(fileID , b)
next i
CloseFile(fileID)
t# = timer()
t_memblockToFile# = t# - t1#
//clear the memblock
for i = 1 to memblockSize
SetMemblockByte(myMemblock , i - 1 , 0)
next i
t1# = timer()
t_memblockClear# = t1# - t#
//read a file into memblock
fileID = OpenToRead("memblockdump.dat")
for i = 1 to memblockSize
if FileEOF(fileID) = 0
b = ReadByte(fileID)
SetMemblockByte(myMemblock , i - 1 , b)
endif
next i
CloseFile(fileID)
t# = timer()
t_fileToMemblock# = t# - t1#
rem A Wizard Did It!
do
Print("memblock size = " + str(memblockSize))
Print("make memblock time = " + str(t_makememblock#))
Print("block to file time = " + str(t_memblockToFile#))
Print("clear block time = " + str(t_memblockClear#))
Print("file to memblock time = " + str(t_fileToMemblock#))
Sync()
loop