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 › help streamlining my code, slightly jerky in draw
Page Index Toggle Pages: 1
help streamlining my code, slightly jerky in draw (Read 944 times)
help streamlining my code, slightly jerky in draw
Apr 27th, 2010, 11:36pm
 
Here is the project I'm working on:

http://www.zakgreene.com/deep

I'm eventually intending to pull in results from the Google suggest bar, using questions leads like "what does," "who is," "why are" etc. What I'm working with now is just a static XML file that I have created. Now, the XML will eventually be composed of 30 random questions pulled from a larger database. So I am making ArrayLists for each question type (who what when etc).

Although not terrible, as the complexity of my code has increased the movement has become slightly jerky. The code is only going to become more complex as I add a second state upon clicking a question, so I wondered if anyone had suggestions on what I could do to help this.

Your help would be greatly appreciated! My Graphic Design BFA degree project hangs in the balance!
Re: help streamlining my code, slightly jerky in draw
Reply #1 - Apr 28th, 2010, 1:05am
 
I don't find it jerky, even on my old computer...
Beside, sometime Processing animations aren't as smooth as we wish they are, although it happens more with large drawings than with those you show.
Last remark: some sentences are odd, syntactically speaking...
Re: help streamlining my code, slightly jerky in draw
Reply #2 - Apr 28th, 2010, 8:53am
 
Consider the sentences as placeholders. I just wanted to make sure there were an evenish number of who, what, when, etc. On my computer sometimes it freezes for a cycle or two. This happens roughly every 4-5 seconds. It's not terrible, but enough that it bothers me, and makes me wonder how http://wefeelfine.org got it so smooth.
Re: help streamlining my code, slightly jerky in draw
Reply #3 - Apr 28th, 2010, 9:24am
 
Such pause is typical of garbage collector kicking in...
But I don't see much objects created in your draw loop, unless Processing generates them?
Re: help streamlining my code, slightly jerky in draw
Reply #4 - Apr 28th, 2010, 9:32am
 
What is "garbage collector"?
Re: help streamlining my code, slightly jerky in draw
Reply #5 - Apr 28th, 2010, 2:30pm
 
it's the built-in mechanism that checks which objects in your program are of no use anymore and could be wiped out of memory. that prevents you from writing myObject = null; when you're done with an object.
Page Index Toggle Pages: 1