Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM2 V5.05.06exp: Huge performance improvement - please test
Page 1 of 8 | |||||
Author | Message | ||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8570 |
Please run as many of your programs as possible to test for any issues. This experimental release implements a full hashing system for variable lookup CMM2V1.5.zip V5.05.06exp V5.05.05 |
||||
qwerty823 Newbie Joined: 30/07/2020 Location: United StatesPosts: 30 |
Awesome! I just ran Pete Cotton's Heliblast with this and framerate went from an 10-11 fps to a solid 20. Also had roughly the same increase for Mauro Xavier's Gauntlet port (though I can't recall the lower bounds, it would drop to less than 10 when it had max monsters on the screen, now it just blips below 20) |
||||
LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 440 |
Very nice improvement. I'll try it today. Are you thinking adding this experimental variable lookup table to the final version? I guess this new lookup table has a performance complexity O(1) for the best case, am I right? What is the current implementation performance complexity? Edited 2020-10-21 00:50 by LeoNicolas |
||||
qwerty823 Newbie Joined: 30/07/2020 Location: United StatesPosts: 30 |
A few updates before I need to get back to work: When I run my testing program from this thread I get a firmware crash when using a constants file with 1000 constants. With 900 or less, it runs MUCH faster. The 198.236 (first variable case) jumped up to around 207 ms (for 100k iterations), so you take about a 5% hit for the first variable case, but go from almost 11 secs down to around 382 ms for the second case (where the variable would have been number 1002 in the vartbl). I notice its not quite constant time (O(1)) as I increase the number of constants, but the timings stay real close to that 207 number until I get to around 500 constants, then slowly creeps up. Either way, huge wins in terms of speed. I really hope this stays, even it takes a bit of tweaking to get it beyond experimental. Awesome work, as always, Peter. |
||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I'm anxious to back home to test my games, mainly the INTO THE DARKNESS. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8570 |
Minor update. There is a maximum of 1024 variables (there always was just not documented). The code now checks for there being too many and gives a sensible error message rather than crashing. CMM2V1.5.zip As long as no-one finds any programs that no longer work with this version and that I can't diagnose and fix the change will make it to the V5.05.06 release. As qwerty823 reports you will see a drop off in performance when the number of variables exceeds around 500. This is because the hash collisions will increase dramatically as the number of free slots in the 1024 element hash table decreases. IMHO any program using over 500 variables needs some serious rework Use MM.INFO(VARCNT) to find how many are active in your programs - worst case will be in the most deeply embedded complex subroutines For info the hashing algorithm used is FNV-1a with a 32 bit hash key masked to 10 bits Edited 2020-10-21 02:20 by matherp |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1133 |
Hi Peter, you don't intend to reintroduce the "ERASE" command? Kind regards Michael |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8570 |
It is there - just missed in the manual together with ERROR |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1133 |
oops! |
||||
elk1984 Senior Member Joined: 11/07/2020 Location: United KingdomPosts: 227 |
Thanks Peter - best kind of upgrade, more performance for no recoding |
||||
Barbiani Newbie Joined: 18/10/2020 Location: BrazilPosts: 6 |
Are you using a version control software? Will be there a patch file that adds the hashing? Edited 2020-10-21 06:42 by Barbiani |
||||
Sasquatch Senior Member Joined: 08/05/2020 Location: United StatesPosts: 296 |
I have run everything I can find with no errors. I did notice a few oddities likely not related to the hashing upgrade: 1. Turtle fill routine seems to be broken again. I know you had this fixed but at some point must have reverted to old code again. See this thread for sample code that does not seem to work: https://www.thebackshed.com/forum/ViewTopic.php?TID=12471&PID=151690#151690#151690 2. Some of the old programs using line graphics seem to be not giving continuous lines? This may be due to other changes along the way. I'll post more details if I find anything that can't be fixed by updating to latest commands. -Carl |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 313 |
Can I ask if you have a 400mhz or 480mhz version of the CMM2? I ask because I was quite worried that heliblaster would be unplayable on a 400mhz. I did consider having an option to have fewer objects on the screen - to keep it playable. This update alone would fix that issue. I can't wait to try it out this evening (also it will significantly help with my next game). |
||||
qwerty823 Newbie Joined: 30/07/2020 Location: United StatesPosts: 30 |
I have the 400Mhz pre-assembled board from circuit gizmos. |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 313 |
Thanks. This is excellent news. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8570 |
Not sure what you mean. Works for me - filled shapes to the right of the centre line as I would expect. No and no Edited 2020-10-21 07:49 by matherp |
||||
PeteCotton Guru Joined: 13/08/2020 Location: CanadaPosts: 313 |
Can I ask if you have a 400mhz or 480mhz version of the CMM2? I have the 400Mhz pre-assembled board from circuit gizmos. Wow. I just switch on the FPS counter and did a quick before and after videocapture of the game and .... wow! Interestingly, I got almost exactly the same frame rates (11ps going up to 20fps with the new firmware) with a 480mhz (as Qwerty823's 400mhz). This is excellent news, as it means that for whatever reason, there doesn't appear to be much difference between the machines, so my worry of developing games that might struggle on other machines is thankfully unfounded. I have included a video link below. At the 15 second mark it switches from 05.05.06RC3 to the 05.05.06exp firmware... and holy smokes, the game goes insane. https://youtu.be/dZmtP6rtKFM I am doing a tonne of maths, lookups and rotations in the code, so somewhere along the line this has almost doubled the speed. Thank you one again Peter - this is a fantastic and unexpected boost! It's like an early Christmas present. |
||||
Barbiani Newbie Joined: 18/10/2020 Location: BrazilPosts: 6 |
Another good boost could come from the blit routines if they are not using the processor facilities. I have seen that the memory functions were using byte access instead of 32bit were possible. |
||||
Sasquatch Senior Member Joined: 08/05/2020 Location: United StatesPosts: 296 |
Something strange going on with filled boxes using Box command. Seems like borders not drawn or drawn in Black. I'll try to give more info and some examples when I have more time to investigate. -Carl |
||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I´ve tested all my programs and everything is very faster!! The INTO THE DARKNESS in debug mode was running about 11 FPS and now stays between 16 to 18 FPS! Gauntlet now reaches easily 30 FPS and can keep 20 FPS with four players with no penalty. Congratulations, Peter... You this time have surpassed all my expectations. No words can express my admiration for your awesome work. |
||||
Page 1 of 8 |
Print this page |