A wasted morning trying to reduce CPU load for my GUI

    Feb 23 2013 | 4:15 pm
    Hi everyone, I've had a bitch of a morning. I've been building a patch for the past few month which is nearing completion, unfortunately the CPU load of the GUI is inhibitive, especially as it will eventually run on some fairly old computers. The patch centers around four loopers, one of which is pictured below. The bright segment of the ring spins with the loop, the shorter the loop the faster the ring spins. With really short samples this send the CPU load on my (pretty fast) computer crazy, 100%+ load.
    I've tried numerous things to counter this. Originally the ring was linear, as you can see it is now segmented into 8. Its currently set up to work with LCD, I've spent all morning digging into Javascript using JSUI, this has not reduced the load in the slightest, in fact its increased it! I've also tried the fantastic sadam.canvas but that also hits my CPU pretty hard at these very fast rates. I've tried speedlim, but anything less that 100ms still adds unacceptable load and anything above that looks a bit shit with the graphics stuttering out of time.
    So what to do now? I'm starting to look at jit.gl.sketch but I can't help noticing that it renders in 3D, will this incur an even greater load? What objects would you recommend? These loopers appear pretty big on screen, and for very short samples they can rotate very quickly. Would value any input at this stage. :(

    • Feb 23 2013 | 4:59 pm
      So I guess what I'm looking for is the most efficient way to draw an arc in max...
    • Feb 23 2013 | 5:10 pm
      By chance I have had a JSUI week too, and actually in my case I did find quite a good reduction in terms of cpu in relation to lcd. Anyway, in this case, instead of using drawing commands, could it be possible to export all possible states as images and alternate between them using pictslider?
    • Feb 23 2013 | 5:17 pm
      I'd tried loading alternate images but not pictslider, I'll have a go now. Thanks jvkr :)
    • Feb 23 2013 | 5:40 pm
      So I've had a play with pictslider in this context, its still a pretty big hit when "scale knob" is selected. The circles fo fill up the screen and they need to scale dependent on screen size.
    • Feb 23 2013 | 6:22 pm
      Hi Barry!
      jit.gl.sketch may well be faster, even though it's 3D, because it'll be GPU-optimised (though how much this helps will depend on where you're rendering to). I'd give it a go. You might also look at jit.mgraphics, although I suspect that wouldn't lighten the CPU load. I don't know for sure as I've not had time to get to know it yet.
    • Feb 23 2013 | 10:42 pm
      Hi Jo, good to hear from you! jit.gl.sketch does appear to be much faster with much less of a CPU hit, I'll keep knocking on that door I think!
    • Feb 24 2013 | 4:01 pm
      Hi, Barry
      You also might want to have a look at the jit.gl.lua object. It combines scripting with the openGL world.
      I recently created a timeline GUI for the jit.path objects and it renders without any problem on high framerates.
      You can even capture your results from within lua to a texture for further use.
    • Feb 24 2013 | 6:45 pm
      from looking at it i would say switch to [lcd]
    • Feb 24 2013 | 7:08 pm
      It was originally written for [lcd], thats been a major part of the problem, [lcd] gobbles up massive amounts of my CPU. Been running jit.gl.sketch at very rapid frame rates with a massive reduction in CPU, its dropped from 105% to 15%! :)