Main Menu

question regarding speed

Started by leopardps, September 23, 2016, 01:15:59 AM

Previous topic - Next topic

leopardps

As I understand things (which is still very limited...), PlayBasic is 'tokenized', meaning that it converts the code to various symbolic tokens for keywords, etc.  When this is run from the IDE, it goes through this tokenized representation of the code and runs the respective routines for each command.  This 'should' be inherently a bit slower than being compiled, and it is a bit slower when compared to the speed of the compiled PlayBasic .exe execution.  I am coming from another basic which I have used for years and is known for its speed and is compiled... but in a quick & basic comparison of throwing up an image to the screen, it appears that PlayBasic, even if run from the IDE (tokenized form), is a significant bit faster (almost 10%!!!!).  My testing method was very crude and I should probably refine it a bit to account for some other things, but, I must say.... Congrats to Kevin and whomever else developed PlayBasic!  Very impressive speed, not to mention all the game specific and graphic oriented commands which are pretty powerful and save alot of coding time... pretty well thought out!

Here is a question that I haven't been able to figure out yet:
In my 'other' basic, I am often utilizing pointers (to the screen memory, which would be the back buffer) to directly read or set pixel values for fast screen manipulations and effects... I have found your memory access commands and pointer things, but can't find the way to get the address of the screen (back buffer) - is it possible?

Kevin,
I do have some questions that you could probably easily answer in comparing PlayBasic to the 'other' basic I use - but to do so would require me to name it and I don't know if you would appreciate me doing that in the forum... is there a way I can contact you privately (won't abuse) so I can understand better how PlayBasic works in comparison?

kevin


QuoteI have found your memory access commands and pointer things, but can't find the way to get the address of the screen (back buffer) - is it possible?

   The screen is image 0,  so Render to the screen, lock it and get the images pointer..   However, since the screen image will be in held in video memory,  reading form it with the CPU  is waste of time.     Create an FX surface of the required size, then man handle the image and when  you're done draw it the screen.. 

   It's worth noting that PB was never designed for man handling pixels on one to one basis.  There's a second tool call PB2DLL which coverts PB code to machine code where you call the functions at will..   


Quote
I do have some questions that you could probably easily answer in comparing PlayBasic to the 'other' basic I use

   Sorry, but simply don't time for it at the moment..


leopardps

Quote from: kevin on September 23, 2016, 05:26:14 AMThe screen is image 0,  so Render to the screen, lock it and get the images pointer..   However, since the screen image will be in held in video memory,  reading form it with the CPU  is waste of time.     Create an FX surface of the required size, then man handle the image and when  you're done draw it the screen.. 

   It's worth noting that PB was never designed for man handling pixels on one to one basis.  There's a second tool call PB2DLL which coverts PB code to machine code where you call the functions at will..   
goodto know - thanks!


QuoteSorry, but simply don't time for it at the moment..
totally understand, this is a huge undertaking, and add in real life and time slips away... hang in there!