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.

DarkBASIC Professional Discussion / Read memory block Coding block(very slow) writng memoryblock (Very slow and wrong)

Author
Message
bfrnhout
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Vlissingen
Posted: 20th Jan 2016 22:25
I have tried differend option and all option is coming out to work slow and/or corrupt the file.

1. i try to read in a file (.bmp) byte per byte. Run a XOR the byte and write it to a big file. (file size 750 Kb) that is not that big. Took DBP 21 minute to read code and write.
2. Read DWORD in XOR it and write it to a big file. Toke DBP 19 minutes to read code and write.
3. Make memblock of total file, read file in to memblock (went very fast),Then coding XOR byte per byte. toke DBP 27 minutes to code the file. Then writing to big file( also very fast) But there where some extra byte in the big file i do not need.
4. Same as 3 but now XOR DWORD took even langer then 29 minutes, with the same results.

It is stranges why DBP is going so SLOOOW with data coding. I wanted to make a program that easly switch between full screen and windowed view. That is DBP strong point. Everything else is working like a charm.

The code is:



the file is everything xoring. I want to do this cause the graphics are still changing and to minimize the download (And a low space of storage on my site) i can update the graphics then.

I can not have this time when a program is starting up and start reading the big file to recode all data. An the program is taking 26 minutes te decode.

I have done this also in Blitz3DBasic and to my supprise the compilled program is doing this jou in 22 sec and creating a big file of 21 MB. Testing it by letting the big file decoding back to original files this one take 35 sec.
Now why can't DBP do this.

Dont tell me that the read write to a disk is the problem because if that wat true then Blitz3DBasic must have been slow to!!
Games is live so to live do the games
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Jan 2016 22:44
Looks like you turned the sync off. Leave it on and call sync at the end of your file routines.

I think the syncing is iteration in combination with screen refresh based. With no sync, your iterations (loops) will not be maximized (at least that's how DB classic performed)
Enjoy your day.
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 21st Jan 2016 01:07 Edited at: 21st Jan 2016 03:14
EDIT: Ignore all I wrote previously if you read it as it relates to screen refresh rate,, don't know what I was thinking but I have been awake for a couple days now!
You might want to check out a free plugin by IanM called matrix1utils here https://forum.thegamecreators.com/thread/85209
It has a number of commands much faster than some DBP commands
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Jan 2016 22:52
...and when I say at the end of your loops, I mean after

while something something
file stuff
other stuff
endwhile

sync
Enjoy your day.

Login to post a reply

Server time is: 2024-04-26 11:31:26
Your offset time is: 2024-04-26 11:31:26