Hi Paul
At last I am able to get back to this issue after a long break.
One clarification to make: the long delay is seen on the target system only and not on the Prototyping environment.
By the Draw() method do you mean the various XXX_Draw() methods in generated codes? The generated codes is not modified.
To use EwPrintPerfCounter() and since EwGetPerfCounter() is not implemented, I added codes to EwGetPerfCounter() similar to this:
unsigned long eticks = getElaspedTimeTicks();
*aSeconds = (eticks/ticks_per_second));
*aMicroSeconds = *aSeconds * 1000000;
*aCPUMicroseconds = eticks;
Do these look right to you?
With that the perfcounter metrics for a normal Update() (not the first one) is:
-----------------------------------------------------------------------------------------------
Group Name [ Calls ] [ Time Total ]
-----------------------------------------------------------------------------------------------
Total Time 1 16.000 ms 0.1% of real CPU time
Graphics_Engine_API 36 13.000 ms 81.3%
Platform_Integration_API 26 12.000 ms 75.0%
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
Graphics_Engine_API [ Calls ] [ Time Total ] [Time Avg] [Time Min] [Time Max]
-----------------------------------------------------------------------------------------------
EwBeginUpdate 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwEndUpdate 1 12.000 ms 75.0% 12.000 ms 12.000 ms 12.000 ms
EwFillRectangle 7 1.000 ms 6.3% 0.142 ms 0.000 ms 1.000 ms
EwCopyBitmap 8 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwTileBitmap 12 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwDrawLine 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwDrawText 3 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwDrawBitmapFrame 3 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
Platform_Integration_API [ Calls ] [ Time Total ] [Time Avg] [Time Min] [Time Max]
-----------------------------------------------------------------------------------------------
EwGfxBeginUpdate 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxEndUpdate 1 10.000 ms 62.5% 10.000 ms 10.000 ms 10.000 ms
EwGfxLockSurface 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxUnlockSurface 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxDrawLine 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxFill 9 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxCopy 12 2.000 ms 12.5% 0.166 ms 0.000 ms 1.000 ms
-----------------------------------------------------------------------------------------------
And the perfcounter metrics for the first Update() is:
-----------------------------------------------------------------------------------------------
Group Name [ Calls ] [ Time Total ]
-----------------------------------------------------------------------------------------------
Total Time 1 211.000 ms 0.1% of real CPU time
Graphics_Engine_API 89 207.000 ms 98.1%
Platform_Integration_API 822 178.000 ms 84.4%
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
Graphics_Engine_API [ Calls ] [ Time Total ] [Time Avg] [Time Min] [Time Max]
-----------------------------------------------------------------------------------------------
EwBeginUpdate 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwEndUpdate 1 202.000 ms 95.7% 202.000 ms 202.000 ms 202.000 ms
EwFillRectangle 8 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwCopyBitmap 16 1.000 ms 0.5% 0.062 ms 0.000 ms 1.000 ms
EwTileBitmap 24 1.000 ms 0.5% 0.041 ms 0.000 ms 1.000 ms
EwDrawLine 24 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwDrawText 9 2.000 ms 0.9% 0.222 ms 0.000 ms 1.000 ms
EwDrawBitmapFrame 6 1.000 ms 0.5% 0.166 ms 0.000 ms 1.000 ms
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
Platform_Integration_API [ Calls ] [ Time Total ] [Time Avg] [Time Min] [Time Max]
-----------------------------------------------------------------------------------------------
EwGfxBeginUpdate 1 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxEndUpdate 1 6.000 ms 2.8% 6.000 ms 6.000 ms 6.000 ms
EwGfxLockSurface 4 58.000 ms 27.5% 14.500 ms 0.000 ms 58.000 ms
EwGfxUnlockSurface 4 0.000 ms 0.0% 0.000 ms 0.000 ms 0.000 ms
EwGfxDrawLine 24 43.000 ms 20.4% 1.791 ms 0.000 ms 3.000 ms
EwGfxFill 33 8.000 ms 3.8% 0.242 ms 0.000 ms 4.000 ms
EwGfxCopy 755 63.000 ms 29.9% 0.083 ms 0.000 ms 2.000 ms
-----------------------------------------------------------------------------------------------
One last point. I was able to 'hide' this issue by starting a timer when the screen is entered. After 50ms the timer calls a slot method to draw an invisible dot on the screen. The timer is then disabled. The idea is to start the first Update() as soon as possible after entering the screen.
With that there is no noticeable delay after the first dot drawn.
Can you see anything from the above and the perfcounter results?
Thanks and regards
Steven