Simple performance test made in P96API (including C source) - WritePixelArray vs Direct MemCpy

Caution: Non registered users only see threads and messages in the currently selected language, which is determined by their browser. Please create an account and log in to see all content by default. This is a limitation of the forum software.


Also users that are not logged in can not create new threads. This is a, unfortunately needed, counter measure against spam. Please create an account and log in to start new threads.

Don't Panic. Please wash hands.
  • Hi,

    I would like to share with this piece of code:

    http://mstanisz.website.pl/tmp/other/AMIGA_TESTS_P96.zip


    I make a simple fullscreen test. I was searching for fast and fastest routine to

    put content of my generated graphic buffer into screen as fast as possible.


    No heavy calculations just filling the buffer.


    I used standard WritePixelArray, but also wanted to try to bypass that using bitmap locking and direct memory copy.

    In WinUae test the direct memcpy is a bit faster.


    I am attaching the source code in C, because maybe someone is insterested in RTG coding and search for similar informations,

    but also maybe someone would improve the code - to make it more general or even faster.

    Please note that the main focus of this code is to fill the whole screen as fast as possible with graphic data.


    The code and test is aimed for 32bit mode.

  • The speed difference is expected. WritePixelArray() is alower than memcpy(), because it needs to do clipping tests on the target format, where conversion may be required. WritePixelArray() will only become a memcpy() if the target format is 8-bit chunky, so your observation is no surprise.

  • The last reply was more than 365 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.