Processing info?

Post Reply
creart
Posts: 31
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Processing info?

Post by creart » Sun Dec 20, 2020 11:14 am

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

ColinP
Posts: 84
Joined: Mon Aug 03, 2020 7:46 pm

Re: Processing info?

Post by ColinP » Thu Dec 24, 2020 3:05 pm

I think you are expected to use a profiler but sometimes that's a bit like using a helicopter to deliver a pizza.

ymerejsasnak
Posts: 52
Joined: Thu Jun 04, 2020 2:08 am

Re: Processing info?

Post by ymerejsasnak » Thu Dec 24, 2020 3:52 pm

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

creart
Posts: 31
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Processing info?

Post by creart » Thu Dec 24, 2020 4:32 pm

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

ColinP
Posts: 84
Joined: Mon Aug 03, 2020 7:46 pm

Re: Processing info?

Post by ColinP » Thu Dec 24, 2020 8:03 pm

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.

creart
Posts: 31
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Processing info?

Post by creart » Sat Dec 26, 2020 1:13 pm

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...

User avatar
haslo
Posts: 16
Joined: Wed Dec 09, 2020 9:09 pm

Re: Processing info?

Post by haslo » Sat Dec 26, 2020 5:21 pm

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.
Last edited by haslo on Thu Dec 31, 2020 7:35 pm, edited 1 time in total.

creart
Posts: 31
Joined: Sat Dec 19, 2020 12:13 pm
Location: Netherlands
Contact:

Re: Processing info?

Post by creart » Sun Dec 27, 2020 12:59 pm

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!

Post Reply