Page 1 of 1

Processing info?

Posted: Sun Dec 20, 2020 11:14 am
by creart
Hi, I'm building my first modules with Module Designer, but I seem to be missing any processing information - load on the CPU, how much memory is uesd... that kind of info.. Reaktor did have options for that...
Is there any module available that gives that kind of info while designing??
Looking through the library within VMD itself, I could not find anything useful for this or did I overlook anything?

Hope someone can help..
cheers Hans

Re: Processing info?

Posted: Thu Dec 24, 2020 3:05 pm
by ColinP
I think you are expected to use a profiler but sometimes that's a bit like using a helicopter to deliver a pizza.

Re: Processing info?

Posted: Thu Dec 24, 2020 3:52 pm
by ymerejsasnak
Hi,

There's some info in previous posts on using VisualVM (a free profiler). However, you need to choose to "Run With Profiler Support" from the Designer menu...and I'm not sure about others, but for me this does not work... CA have said it will be fixed (I think they said or implied in the next VMD update, but don't quote me on that). I'm waiting on that, too, because I got a module rejected recently for high CPU usage. Admittedly it was totally my fault for poor handling of canvas drawing...still, it would be very helpful to see more precisely what's going on CPU wise, especially when trying to do a bunch of custom drawing operations.

JK

Re: Processing info?

Posted: Thu Dec 24, 2020 4:32 pm
by creart
Thanks JK! Ya, I eventually found that within the forum here and have yet to try that...
I would have expected more tools on CPU and memory-use to be within the designer itself but apparently I expected too much :-)
Will have a try later to see if I get this to work, it's always good to be able to see where problems lie, if any...
And good for optimization too ofcourse...

cheers Hans

Re: Processing info?

Posted: Thu Dec 24, 2020 8:03 pm
by ColinP
A simple user level gadget that indicates CPU usage per module would be great. Then not only devs but users would be able to optimise stuff.

At the moment I rely on crude techniques like doing A/B testing while running multiple instances (to amplify the effect) of the module under development and examining the loads shown by Windows Task Manager. It's primitive to say the least.

Re: Processing info?

Posted: Sat Dec 26, 2020 1:13 pm
by creart
Ya I think the designer is still in its' infancy level :-) I should probably not compare it to 'more mature' developing tools.... but the problem is that when having worked with such tools you tend to expect to find it everywhere...

Re: Processing info?

Posted: Sat Dec 26, 2020 5:21 pm
by haslo
I'm taking my actual dev work into IntelliJ with external classes. Did the first three plugins in the VMD alone (plus Sublime Text as external editor), but I do value the benefits of a full-fledged dev environment for the more complex things I've now started building.

I also had one update for one of my modules rejected because of CPU usage - I did the old school thing and just added microsecond counters like so, with two class variables `calculationTime` and `countedSamples` (both initialized with 0):

Code: Select all

long start = System.nanoTime();

// ProcessSample computations go here

long finish = System.nanoTime();
calculationTime += finish - start;
countedSamples += 1;
if (countedSamples == 20 * 48000) {
    countedSamples = 0;
    calculationTime = 0;
}
...and then I set a breakpoint in that `if`. This gave me a regular update with a variable holding the ns needed for the last 20 seconds of audio processing. Was enough for me here, but YMMV and of course it depends on the complexity of your processing (also, this doesn't have any storage checks - in my case, I didn't even use objects, much less anything that'd need to be GC'd or any other larger data structures).

Edited to add, I do think that the VB style UI editor that Cherry built is rather impressive. I'm just so used to things like multiple cursors, built-in refactoring, extensive autocomplete etc.

Re: Processing info?

Posted: Sun Dec 27, 2020 12:59 pm
by creart
Thanks Haslo - I will look into IntelliJ - so far I have been programming in C++, PHP and JavaScript - the change to Java isn't that huge, obviously have to look for some differences, but that's not so hard.. But indeed having some proper system including good debugger and profiler can make the difference :-)

Buy ya - the UI editor is absolutely great, including the Skin Editor!