Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

What is better?

Post any examples or modules that you want to share here

What is better?

Postby gvalletto » Thu Sep 19, 2019 8:15 pm

Hi all. When I made some own modules, I often got several ways to get the same results. Finally I choose the one that spends less CPU cycles or RAM or another efficiency feature. Sometimes I can´t to see which ones spend less of that charges.
If anyone has the same problem that me, I propose to post here that modules (in OSM or screenshot), so anybody can help with the choosing, adding short explanation.

I start with an example. It`s a real doubth from mine, so please help :)
select.JPG
select.JPG (41.68 KiB) Viewed 18702 times
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

Re: What is better?

Postby Spogg » Fri Sep 20, 2019 7:39 am

This is a very interesting idea for a topic. In most cases I won’t be able to help but I hope to learn from anyone else who can give explanations.
I do know that the number of triggers generated when something changes is important, so one thing I could suggest is to make use of the trigger counter module as a basis for comparison. But that doesn’t take into account of what happens “inside” the various prims.

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: What is better?

Postby RJHollins » Fri Sep 20, 2019 7:51 am

Interested too !
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: What is better?

Postby chackl » Fri Sep 20, 2019 10:43 am

Hello!

When i want to test something on CPU usage and compare it - i do a loop an call it "a lot" like here 1000000 times.
Then i do a measurement from the time it needs. The lower time - the more cpu efficient

I made a tiny schematic with an time-measurement that calls the selecter and the array in the same way - including at least one "Int-Input-Box" to show the value and simulate to do something.

Results:
On 1000000 steps the selector needs: 0.496 seconds to complete
On 1000000 steps the array needs: 0.437 seconds to complete

Something equivalent in ruby by array need 0.073 seconds.

Warning:
Do not match ruby and green! Ruby and green are running dethreaded and would not deliver the correct time-measurement!

Edit and Summery:
It seems the Array is a little faster - and i think it is more comfortable to use.
If you want to built something that need realy cpu efficiency you should go into ruby and stay there until you got the final results and then pass them to green.

Regards, C.Hackl
Attachments
Test-Selector-vs-Array.fsm
(1.37 KiB) Downloaded 950 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
User avatar
chackl
 
Posts: 233
Joined: Tue Aug 17, 2010 8:46 pm
Location: Austria / Salzburg

Re: What is better?

Postby RJHollins » Fri Sep 20, 2019 5:00 pm

very cool C.Hackl

thanks 8-)
RJHollins
 
Posts: 1571
Joined: Thu Mar 08, 2012 7:58 pm

Re: What is better?

Postby tulamide » Fri Sep 20, 2019 10:27 pm

Just make sure that any tests involving Ruby stay a good portion under 10 seconds, as this is the latest at which Flowstone will automatically shutdown Ruby assuming an infinite loop.

EDIT: And a reminder that the array example only was slightly quicker, because the get at prim sends no backtriggers but stores the converted array (and so no string to array conversion on each "get at" takes place). This is not always the case! A lot of prims do use backtriggers.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: What is better?

Postby wlangfor@uoguelph.ca » Sun Sep 22, 2019 2:54 pm

tulamide wrote:Just make sure that any tests involving Ruby stay a good portion under 10 seconds, as this is the latest at which Flowstone will automatically shutdown Ruby assuming an infinite loop.

EDIT: And a reminder that the array example only was slightly quicker, because the get at prim sends no backtriggers but stores the converted array (and so no string to array conversion on each "get at" takes place). This is not always the case! A lot of prims do use backtriggers.


you make an interesting point regarding the array
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: What is better?

Postby gvalletto » Tue Sep 24, 2019 5:08 am

I am happy with all the posts, and I am glad that them make interest for several people. Go ahead!
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina

Re: What is better?

Postby wlangfor@uoguelph.ca » Mon Sep 30, 2019 1:56 am

You forgot another primitive, if else. It'd be sensible to test it against that, also the index selector come to think of it. Just name the string number names, does the same.

Makes Me curious,
My youtube channel: DSPplug
My Websites: www.dspplug.com KVRaudio flowstone products
User avatar
wlangfor@uoguelph.ca
 
Posts: 912
Joined: Tue Apr 03, 2018 5:50 pm
Location: North Bay, Ontario, Canada

Re: What is better?

Postby gvalletto » Tue Oct 01, 2019 1:38 am

Good sugestions! Thanks.
User avatar
gvalletto
 
Posts: 117
Joined: Fri Jul 09, 2010 10:15 pm
Location: Argentina


Return to User Examples

Who is online

Users browsing this forum: No registered users and 75 guests