<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: improving performance of addJSONData</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on improving performance of addJSONData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31331</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31331</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>I expect possible memory leeks problems more in <em>deleting</em> of existing rows (in <strong>emptyRows</strong>), but placing replacing the table body with new content, where the only existing row is the first one, (at least in case of <strong>scroll:false</strong>) seems me safe. It's strange, but setting ofÂ <strong>ts.grid.bDiv.scrollTop</strong> to <strong>0</strong> (even it the old value is already <strong>0</strong>)Â take really a lot of time.Â I could not find any case when the setting is needed. Probably you can remind you better about such cases or just the condition in "<strong>if</strong>" is wrong.</p>
<p>In any way it's good to test the suggested modification.</p>
<p>Best regards<br />
 Oleg</p>
<p>P.S. Please don't forget aboutÂ <a href="https://github.com/tonytomov/jqGrid/pull/644" target="_blank">the pull request</a>Â and aboutÂ <a href="https://github.com/tonytomov/jqGrid/issues/612#issuecomment-56725014" target="_blank">the post</a>Â when you find time for it. We wait for new release of jqGrid too. Best wishes!Â </p>
]]></description>
        	        	<pubDate>Mon, 03 Nov 2014 18:40:05 +0200</pubDate>
        </item>
        <item>
        	<title>tony on improving performance of addJSONData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31326</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31326</guid>
        	        	<description><![CDATA[<p>Hello Oleg,</p>
<p>Â </p>
<p>Thanks. We should apply this with care.</p>
<p>As far as I remember (maybe I'm wrong) there was a problem with the memory when using this approach.</p>
<p>Instead I will try to make more deeper investigation.</p>
<p>I'm little busy these days, but will made the needed.</p>
<p>Thank you again.</p>
<p>Kind Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 03 Nov 2014 18:08:30 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on improving performance of addJSONData</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31325</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/improving-performance-of-addjsondata#p31325</guid>
        	        	<description><![CDATA[<p>Hello Tony,</p>
<p>the analyse of performance of jqGrid with large number of rows have shown that there are two most expensive lines: <a href="https://github.com/tonytomov/jqGrid/blob/v4.6.0/js/grid.base.js#L1577" target="_blank">the line</a>Â </p>
<div class="sfcode">
<pre class="brush-javascript syntax">$("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(''));</pre></div><p>where the grid body will be placed to the HTML page and <a href="https://github.com/tonytomov/jqGrid/blob/v4.6.0/js/grid.base.js#L1591" target="_blank">the line</a>Â </p>
<div class="sfcode">
<pre class="brush-javascript syntax">if(!ts.p.treeGrid &#38;&#38; !ts.p.scroll) {ts.grid.bDiv.scrollTop = 0;}</pre></div><p>Â where will be made unneeded work because the value of <strong>ts.grid.bDiv.scrollTop</strong>Â seems be always <strong>0</strong> in the if condition (because of callingÂ <strong>emptyRows</strong>Â in <a href="https://github.com/tonytomov/jqGrid/blob/v4.6.0/js/grid.base.js#L1442" target="_blank">the line</a>).</p>
<p>I suggest first replace the lineÂ <strong>$("#"+$.jgrid.jqID(ts.p.id)+" tbody:first").append(rowData.join(''));</strong> to the following</p>
<div class="sfcode">
<pre class="brush-javascript syntax">ts.firstElementChild.innerHTML += rowData.join('');</pre></div><p><a href="http://www.ok-soft-gmbh.com/jqGrid/performane-90000_1000_org.htm" target="_blank">The demo</a>Â demonstrates the performance of original jqGrid with 1000 rows per page from 90000 total rows and <a href="http://www.ok-soft-gmbh.com/jqGrid/performane-90000_1000_new.htm" target="_blank">the same demo with the fixed code</a>Â seems to works quickly in all browsers where I tested it. The most benefit I could see in Internet explorer, but other web browser shown different coefficient of advantage by different number of visible rows, nevertheless the suggested modification seems to work always more quickly.</p>
<p>Best regards<br />
 Oleg</p>
<p>P.S. One can do the same modification in the code ofÂ <strong>addXmlData</strong>.</p>
]]></description>
        	        	<pubDate>Sun, 02 Nov 2014 21:39:23 +0200</pubDate>
        </item>
</channel>
</rss>