<?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[Copy objects -&gt; copy gets slower]]></title><description><![CDATA[<p dir="auto">Hi all,<br />
I have following situation:</p>
<pre><code>QtObject {
    id: blub
    property var obj: ({}) 
}
</code></pre>
<p dir="auto">This property is changed regularly.<br />
The new value is received by a signal and then copied.<br />
But it gets slower with each copy.<br />
For example, the first copy takes 180ms, after a few times it takes 600ms.</p>
<p dir="auto">I tried different ways to copy it:</p>
<pre><code>1) blub.obj = newValue
2) blub.obj = JSON.parse(JSON.stringify(newValue))
3) blub.obj = Object.assign({}, newValue);
</code></pre>
<p dir="auto">What am I doing wrong?<br />
How can I prevent it from slowing down with every copy?</p>
]]></description><link>https://forum.qt.io/topic/163397/copy-objects-copy-gets-slower</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 01:58:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163397.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Oct 2025 12:48:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Copy objects -&gt; copy gets slower on Thu, 02 Oct 2025 08:50:09 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your answer.<br />
In meanwhile I was able to solve this problem.<br />
I think it was related to the singleton.<br />
The <em>QtObject blub</em> was in a singleton-qml-module.<br />
Now I moved this QtObject to the main-qml-module.<br />
Now the copy is much faster and it does not get slower.</p>
]]></description><link>https://forum.qt.io/post/832325</link><guid isPermaLink="true">https://forum.qt.io/post/832325</guid><dc:creator><![CDATA[MHermann]]></dc:creator><pubDate>Thu, 02 Oct 2025 08:50:09 GMT</pubDate></item><item><title><![CDATA[Reply to Copy objects -&gt; copy gets slower on Thu, 02 Oct 2025 08:16:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mhermann">@<bdi>MHermann</bdi></a><br />
Others will know more than I.  Just some thoughts.</p>
<ul>
<li>Just how big is "big"?  MBs?  GBs?</li>
<li>I can imagine/guess that after the initial setting of the property it will destroy its current value before replacing it with a new one.  That could add (quite?) some time to copies after the first time?</li>
<li>Is this specifically a JSON issue?  If you create a property which is, say, a huge string do you see the same slow down over time?</li>
<li>Are you able to test with the last Qt 5.15 instead of your 5.12?</li>
</ul>
]]></description><link>https://forum.qt.io/post/832321</link><guid isPermaLink="true">https://forum.qt.io/post/832321</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 02 Oct 2025 08:16:24 GMT</pubDate></item><item><title><![CDATA[Reply to Copy objects -&gt; copy gets slower on Thu, 02 Oct 2025 05:48:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am using Qt5.12.7.<br />
I am developing the app on Linux and then it gets cross-compiled to run Raspbian.<br />
<em>newValue</em> is a big json-object.</p>
<p dir="auto">At the moment I don't have a minimal example.</p>
<p dir="auto">Has anyone ever had the problem that copying values ​​becomes slower over time?</p>
]]></description><link>https://forum.qt.io/post/832317</link><guid isPermaLink="true">https://forum.qt.io/post/832317</guid><dc:creator><![CDATA[MHermann]]></dc:creator><pubDate>Thu, 02 Oct 2025 05:48:32 GMT</pubDate></item><item><title><![CDATA[Reply to Copy objects -&gt; copy gets slower on Wed, 01 Oct 2025 16:00:21 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Which version of Qt ?<br />
On which OS ?<br />
What is <code>newValue</code> ?</p>
<p dir="auto">Can you provide a minimal compilable example that shows this issue ?</p>
]]></description><link>https://forum.qt.io/post/832301</link><guid isPermaLink="true">https://forum.qt.io/post/832301</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 01 Oct 2025 16:00:21 GMT</pubDate></item></channel></rss>