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.
IndexProcessing DevelopmentLibraries,  Tool Development › Performance of plugged methods in oscP5
Page Index Toggle Pages: 1
Performance of plugged methods in oscP5 (Read 2342 times)
Performance of plugged methods in oscP5
Apr 4th, 2010, 4:20pm
 
While working with plugged methods in oscP5 I noticed an area where performance could potentially be improved.  It appears that oscP5 tracks plugged methods in an ArrayList named _myOscPlugList.  Consequently method lookup is linear in the number of methods that are plugged.

I'm currently writing a grid sequencer with 160 buttons, and my program runs quite slowly if I attempt to use oscP5.plug to handle the routing osc messages.

Performance could be improved considerably if oscP5 stored plugged methods in a HashMap keyed by address pattern and typetag.

Is there some reason why a HashMap would not work for this purpose?  Would the author of oscP5 be interested if I submitted a patch to oscP5 that made this change?

(Dan)
Re: Performance of plugged methods in oscP5
Reply #1 - Apr 4th, 2010, 9:02pm
 
hi dan,
sounds good to me, improvements are always welcome. if your patch is not too long, please post it here otherwise you could send it as a direct message or via email. just curious, do you encounter performance issues without using oscP5.plug as well?
best,
andreas
Re: Performance of plugged methods in oscP5
Reply #2 - Apr 4th, 2010, 9:42pm
 
Performance seems reasonable when not using oscP5.plug, though I did notice that CPU utilization is quite high (above 90%).  My working hypothesis on the high CPU load is that it's something in my draw method.  I'll try to write up the changes to oscP5 sometime this week, and post or send the patch.

(Dan)
Re: Performance of plugged methods in oscP5
Reply #3 - May 3rd, 2010, 8:10pm
 
Andreas,

FYI, I emailed you a patch for this.  Let me know when you have a chance to look it over, or if you did not receive it.

(Dan)
Re: Performance of plugged methods in oscP5
Reply #4 - May 3rd, 2010, 8:55pm
 
hi dan,
received the patch, thank you, including it now.
best,
andreas

Re: Performance of plugged methods in oscP5
Reply #5 - May 4th, 2010, 7:42am
 
Great!  Let me know when the new release is posted.
Re: Performance of plugged methods in oscP5
Reply #6 - May 9th, 2010, 7:42am
 
Hmm... the oscP5 web site says the latest release is version 0.9.6 from 05/04/2010, but when I download and unzip it all the files are dated February 9, and examining the source it does not appear to have my patch.  Is it possible the download link is still pointing at an older version?

(Dan)
Re: Performance of plugged methods in oscP5
Reply #7 - May 9th, 2010, 8:16am
 
hi daniel, was pointing to an older version, should now be up to date. best, andreas
Page Index Toggle Pages: 1