<?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[Faster JS in QML]]></title><description><![CDATA[<p dir="auto">Hello,<br />
does it have any sense to perform QML/JS optimizations such as:</p>
<pre><code>for (var i = 0; i &lt; repeater.count; i++) {...}
</code></pre>
<p dir="auto">optimized:</p>
<pre><code>for (var i = 0, n = repeater.count; i &lt; n; i++) {...}
</code></pre>
<p dir="auto">or:</p>
<pre><code>                var bucketImage = brushImage_colorAnimation.bucketImage
                brushCanvas.color = brushImage_colorAnimation.color
                if (bucketImage.bucketCanvas)
                    bucketImage.bucketCanvas.color = brushImage_colorAnimation.color
                else if (bucketImage.color)
                    bucketImage.color = brushImage_colorAnimation.color
</code></pre>
<p dir="auto">optimized:</p>
<pre><code>                var bucketImage = brushImage_colorAnimation.bucketImage
                var color = brushImage_colorAnimation.color
                brushCanvas.color = color
                if (bucketImage.bucketCanvas)
                    bucketImage.bucketCanvas.color = color
                else if (bucketImage.color)
                    bucketImage.color = color
</code></pre>
<p dir="auto">i.e. basically how fast is property get in QML JS?</p>
<p dir="auto">Does it have any sense to excessively use local variables to cache things that definitely are not going to change?</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/topic/81412/faster-js-in-qml</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 11:14:26 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/81412.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Jul 2017 22:33:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Faster JS in QML on Wed, 19 Jul 2017 09:48:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/karlheinzreichel">@<bdi>karlheinzreichel</bdi></a> Kindly do qmlprofiling for the qmls with and without optimization to see the difference in performance and update. Waiting to see the results.</p>
]]></description><link>https://forum.qt.io/post/405491</link><guid isPermaLink="true">https://forum.qt.io/post/405491</guid><dc:creator><![CDATA[Arvindhan Ponnusamy]]></dc:creator><pubDate>Wed, 19 Jul 2017 09:48:04 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Wed, 19 Jul 2017 09:47:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/arvindhan-ponnusamy">@<bdi>Arvindhan-Ponnusamy</bdi></a> said in <a href="/post/405459">Faster JS in QML</a>:</p>
<blockquote>
<p dir="auto">Things to avoid in binding expressions to maximize optimizability</p>
</blockquote>
<p dir="auto">The code in the OP has nothing to do with binding expressions.</p>
]]></description><link>https://forum.qt.io/post/405489</link><guid isPermaLink="true">https://forum.qt.io/post/405489</guid><dc:creator><![CDATA[kshegunov]]></dc:creator><pubDate>Wed, 19 Jul 2017 09:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Wed, 19 Jul 2017 08:47:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/arvindhan-ponnusamy">@<bdi>Arvindhan-Ponnusamy</bdi></a><br />
As the reference you mention states (chapter Resolving Properties):<br />
Just this simple change results in a significant performance improvement<br />
...</p>
]]></description><link>https://forum.qt.io/post/405477</link><guid isPermaLink="true">https://forum.qt.io/post/405477</guid><dc:creator><![CDATA[karlheinzreichel]]></dc:creator><pubDate>Wed, 19 Jul 2017 08:47:13 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Wed, 19 Jul 2017 07:59:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/karlheinzreichel">@<bdi>karlheinzreichel</bdi></a> Document States<br />
Things to avoid in binding expressions to maximize optimizability:<br />
1.declaring intermediate JavaScript variables<br />
2.accessing "var" properties<br />
3.calling JavaScript functions<br />
4.constructing closures or defining functions within the binding expression<br />
5.accessing properties outside of the immediate evaluation scope<br />
6.writing to other properties as side effects</p>
]]></description><link>https://forum.qt.io/post/405459</link><guid isPermaLink="true">https://forum.qt.io/post/405459</guid><dc:creator><![CDATA[Arvindhan Ponnusamy]]></dc:creator><pubDate>Wed, 19 Jul 2017 07:59:12 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Tue, 18 Jul 2017 14:29:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/karlheinzreichel">@<bdi>karlheinzreichel</bdi></a>  :D yes exactly !  it is good practice to create local copy of properties (inside js functions) work with that local 'var' and when everything is done assigne that local var value to your qml property. Otherwise That property value is reevaluated by QmlJs Engine every time you ref it thats whay it is greedy.</p>
<p dir="auto">You can also use Recursion for your JS functions if you want more optimization.<br />
But best way to optimize your application is to not use js :p or less possible.<br />
*Extend QML with c++</p>
<p dir="auto">LA</p>
]]></description><link>https://forum.qt.io/post/405345</link><guid isPermaLink="true">https://forum.qt.io/post/405345</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Tue, 18 Jul 2017 14:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Tue, 18 Jul 2017 13:58:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/arvindhan-ponnusamy">@<bdi>Arvindhan-Ponnusamy</bdi></a><br />
the article you mentioned states the opposite!</p>
]]></description><link>https://forum.qt.io/post/405339</link><guid isPermaLink="true">https://forum.qt.io/post/405339</guid><dc:creator><![CDATA[karlheinzreichel]]></dc:creator><pubDate>Tue, 18 Jul 2017 13:58:32 GMT</pubDate></item><item><title><![CDATA[Reply to Faster JS in QML on Tue, 18 Jul 2017 13:41:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/andriy-gerasika">@<bdi>Andriy-Gerasika</bdi></a><br />
Creating local attributes cause delay in performance check the below link for more details<br />
<a href="http://doc.qt.io/qt-5/qtquick-performance.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qtquick-performance.html</a></p>
]]></description><link>https://forum.qt.io/post/405336</link><guid isPermaLink="true">https://forum.qt.io/post/405336</guid><dc:creator><![CDATA[Arvindhan Ponnusamy]]></dc:creator><pubDate>Tue, 18 Jul 2017 13:41:58 GMT</pubDate></item></channel></rss>