<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[ANSWERED] Calculation overhead: Javascript vs calculators]]></title><description><![CDATA[<p>I have a quick questions about system overhead as I embark of a patch that will be replicated many dozens of times. Is the overhead of using Javascript greater for doing nestled math calculations vs stringing calculators together in a user actor to do the same calculation?<br /><br /></p>
<p>A couple of examples of a math formula that I am using would be: <br /></p>
<p>B = ((T - 1) * 18) + ((P - 2) * 2) + 1</p>
<p>L=<span class="mspace"></span><span class="strut"></span>((P<span class="mspace"></span>−<span class="mspace"></span><span class="strut"></span>2)<span class="mspace allowbreak"></span><span class="mspace"></span><span class="strut"></span>mod<span class="mspace"></span><span class="mspace"></span>3)<span class="mspace"></span>×<span class="mspace"></span><span class="strut"></span>32<span class="mspace"></span>+<span class="mspace"></span><span class="strut"></span>1</p>
<p>It much easier to put these together in Javascript, but I can do them with calculators if its quicker.<br /></p>
<p>Thanks, J<br /></p>]]></description><link>https://community.troikatronix.com/topic/8714/answered-calculation-overhead-javascript-vs-calculators</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 17:12:44 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/8714.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Feb 2024 16:55:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Wed, 14 Feb 2024 00:37:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@dusx</a> Thanks. Given this, as most of my calculators are used in momentary situations (button press, dial turn) I think that Javascript makes more sense. It greatly simplifies my patching. If I run into a situation where they are updating as a stream, I'll try to use calculators. </p><p>I appreciate your input. </p><p><br />Best, J<br /></p>]]></description><link>https://community.troikatronix.com/post/53432</link><guid isPermaLink="true">https://community.troikatronix.com/post/53432</guid><dc:creator><![CDATA[jtsteph]]></dc:creator><pubDate>Wed, 14 Feb 2024 00:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Tue, 13 Feb 2024 16:51:59 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/975">@jtsteph</a> said:</p>
<blockquote>It much easier to put these together in Javascript, but I can do them with calculators if its quicker</blockquote>
<p> When we first added the Javascript actor, I did a series of deep tests to determine exactly this. What I found was that I could use hundreds/thousands of JS actors doing math and still have good performance... and I could also use Thousands of the Calculator actors.</p><p>I suspect you will have very similar performance either way, however; I believe a series of Calculator actors will be slightly less heavy.<br /></p><p>Due to the nature and easy of doing this in JS, I would personally use JS. But you could easily build both and use a global to switch between the methods used.. allowing you to make a change if performance required it.</p>]]></description><link>https://community.troikatronix.com/post/53431</link><guid isPermaLink="true">https://community.troikatronix.com/post/53431</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Tue, 13 Feb 2024 16:51:59 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Fri, 09 Feb 2024 14:36:14 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/975">@jtsteph</a></p><p>My gut feeling is that JavaScript is less work for the computer, but as <a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@Juriaan</a> said, I don't believe there's a "one-size-fits-all" answer in that it probably depends on the complexity of what you're doing and how you're doing it. </p><p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@DusX</a> might know better than me.</p>]]></description><link>https://community.troikatronix.com/post/53387</link><guid isPermaLink="true">https://community.troikatronix.com/post/53387</guid><dc:creator><![CDATA[Woland]]></dc:creator><pubDate>Fri, 09 Feb 2024 14:36:14 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Thu, 08 Feb 2024 21:32:14 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/975">@jtsteph</a></p><p>Happy to dive deeper with you, but I dont have an answer for you at this moment.</p><p>Will do some testing on my own and report back</p>]]></description><link>https://community.troikatronix.com/post/53382</link><guid isPermaLink="true">https://community.troikatronix.com/post/53382</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Thu, 08 Feb 2024 21:32:14 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Thu, 08 Feb 2024 21:30:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@juriaan</a> Ahaha. Understood. I thought it might be a simple answer. I know you have much more important things to do.  I will just try some stuff and see where I end up. Thanks for reponding.</p>]]></description><link>https://community.troikatronix.com/post/53381</link><guid isPermaLink="true">https://community.troikatronix.com/post/53381</guid><dc:creator><![CDATA[jtsteph]]></dc:creator><pubDate>Thu, 08 Feb 2024 21:30:20 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] Calculation overhead: Javascript vs calculators on Thu, 08 Feb 2024 21:26:54 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/975">@jtsteph</a></p><p>It depends on the amount of replications and this is such a deep technical question that we really have to dive deep into the codebase to figure this out for you :)</p><p><br />For example I dont know or JavaScript code that is in memory needs to be re-initiliazed.</p><p></p>]]></description><link>https://community.troikatronix.com/post/53380</link><guid isPermaLink="true">https://community.troikatronix.com/post/53380</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Thu, 08 Feb 2024 21:26:54 GMT</pubDate></item></channel></rss>