jquery-timeago icon indicating copy to clipboard operation
jquery-timeago copied to clipboard

Perfomance issue onLoad on "larger" page

Open p10tyr opened this issue 10 years ago • 4 comments

I have a page load with a table, in the morning its about 40 elements, towards the end of the day it grows to 200.

I have other scripts running there but I tracked down that timeago "blocks" the page until all the elements are updated... :-1:

"blocks" - Cannot scroll the page or click on any element for 1-3 seconds

I think some optimization may be required as the main page does not mention any limits.

This page could potentially shows thousands of rows with timago applied

Sameple of single row

HTML (after run)

<td data-order="10/28/2015 12:42:31" data-search="10/28/2015 12:42:31" class="sorting_1">
  <abbr class="timeago" title="October 28, 2015 - 12:42:31">9 minutes ago</abbr>
</td>

Server C#

<abbr class="timeago" title="@ex.DateTime.ToString("yyyy-MM-ddTHH:mm:ssZ")">@ex.DateTime.ToString("MMMM dd, yyyy - HH:mm:ss")</abbr>

On this occasion you can see Chrome reports 1.3 seconds but there is still the update dom afterwards I think. (the monitor shows along time, im debugging so it takes long to start but afterwards it runs as normal)

74 rows @ 1.3 seconds ?

image

p10tyr avatar Oct 28 '15 12:10 p10tyr

It sounds like this is a dynamically updating page. Is it possible that this page is repeatedly/recursively calling timeago on the same elements over and over again?

rmm5t avatar Oct 30 '15 20:10 rmm5t

No. I load the table Dom then on load the plugin. Afterwards not again, ever.

On Fri, 30 Oct 2015 at 20:46, Ryan McGeary [email protected] wrote:

It sounds like this is a dynamically updating page. Is it possible that this page is repeatedly/recursively calling timeago on the same elements over and over again?

— Reply to this email directly or view it on GitHub https://github.com/rmm5t/jquery-timeago/issues/248#issuecomment-152647221 .

p10tyr avatar Oct 30 '15 20:10 p10tyr

in the morning its about 40 elements, towards the end of the day it grows to 200.

No. I load the table Dom then on load the plugin.

This is a bit cryptic. If you're manually loading a table DOM, I don't understand how "no" is the answer to whether you're dynamically updating the page DOM?

rmm5t avatar Oct 31 '15 00:10 rmm5t

During the day the result set grows. The html is built in each refresh. No Ajax is used. So early there's few rows later up to 200rows in table. It's manual refresh only.

On Sat, 31 Oct 2015 at 00:32, Ryan McGeary [email protected] wrote:

in the morning its about 40 elements, towards the end of the day it grows to 200.

No. I load the table Dom then on load the plugin.

This is a bit cryptic. If you're manually loading a table DOM, I don't understand how "no" is the answer to whether you're dynamically updating the page DOM?

— Reply to this email directly or view it on GitHub https://github.com/rmm5t/jquery-timeago/issues/248#issuecomment-152679836 .

p10tyr avatar Oct 31 '15 01:10 p10tyr