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.

AppGameKit Classic Chat / Base64 decoder 2.0

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Mar 2017 23:40 Edited at: 9th Mar 2017 02:08
Very happy to announce an updated version to my base64 decoder. Before, operations were all string based and thus became very slow with very large strings. After utilizing memblocks and changing a few other things, I've managed to boost the speed. A lot. By over 1000x actually. My map data for zelda which once took 76,000 ms to just decode now takes about 60 ms or less! The code below contains 5 paragraphs of lorem ipsum, decoded in only 2ms.

Btw, this version only works in AppGameKit 2 because of setMemblockString()


Function list:



March 8, 2017
- Added the rest of the functions and renamed the commands.
- Redesigned the data string so as to not break the code display in the forum


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
GameDevGuy
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 3rd Mar 2017 23:55
Very cool. Thanks for sharing!
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 5th Mar 2017 08:24
Getting something to run 1000x faster is pretty satisfying! Well done.
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Mar 2017 16:37
Fortunately, copying a string into a memblock (previously not available in the command set until AGK2) is very fast. From there, all my decode calculations work with the byte values of characters rather than doing string comparisons or constantly convert string characters with ASC. Ditch strings and the conversions and stick with numbers only and the speed is much better.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Mar 2017 02:10
I've updated the code, it's actually complete now. I added the encoding functions, which I hadn't rewritten to use memblocks until tonight. Unless someone finds a bug, this is the final version.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-11-24 19:36:18
Your offset time is: 2024-11-24 19:36:18