We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Performance suffers in present mode
Page Index Toggle Pages: 1
Performance suffers in present mode (Read 891 times)
Performance suffers in present mode
Oct 1st, 2009, 1:30am
 
Hello,

I wasn't sure where to post this. Please let me know if it would be better to post somewhere else.

I have a sketch which does a lot of very fast swapping of images. It rests on image A for a little while, then very quickly flashes image B, then returns to image A.

My sketch works correctly in non-present mode, but when I view it in present mode, the image swaps aren't as smooth. Often, only part of image B gets shown.

Any ideas about why I'm getting worse performance in present mode? I'm using a MacBook 1.83 ghz, 2g ram, OS 10.5.8

Thanks!

-Morgan
Re: Performance suffers in present mode
Reply #1 - Oct 1st, 2009, 1:58am
 
Since you haven't posted any code it's worth mentioning this just in case: make sure you load images in setup and not in draw.  That seems to be a common error that can affect performance; though I don't know why it should be affected by present mode.
Re: Performance suffers in present mode
Reply #2 - Oct 1st, 2009, 6:51am
 
Thanks blindfish.
Yeah, I'm loading all my images in setup. The difference is subtle, and wouldn't be noticable if I wasn't trying to do really flickery stuff. But the flickers are definitely less clean in present mode.
Re: Performance suffers in present mode
Reply #3 - Oct 1st, 2009, 8:04am
 
Sketch resolution effects performance, so full screen (present) mode may just be pushing more pixels.
Re: Performance suffers in present mode
Reply #4 - Oct 1st, 2009, 8:29am
 
I was about to answer like jeffg: you can't expect Processing to behave as well in a "small" window and full screen.
You omit to specify the resolution of your screen, BTW...

My understanding is that it still takes some time to display an image, that's a number of pixels to move around. So if your "flash" time is lower than this time (depends on frameRate too), you can get a partial display.
Synchronization with display can be a factor too (although I don't know if it is still relevant with LCD displays...).

Last, you might want to try other graphic modes.
Page Index Toggle Pages: 1