EasyUI Forum
May 13, 2024, 06:32:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Question about tabs - Performance problem  (Read 17961 times)
edjeasyui
Newbie
*
Posts: 8


View Profile
« on: November 29, 2013, 05:27:48 AM »

Hallo all!

In our application we add easyui tabs using the href attribute.

Code:
			
$("#selectorX").tabs("add", {
title: 'title',
         href: 'url'
});

Each tab contains many easy ui components (one layout, grids, forms, dateboxes, etc)

When we add many tabs we have serious performance impact (at Internet Explorer 10).

Below is the time that takes for each tab to load (server will repospond with the same content)

1st tab :  8sec
2nd tab: 10sec
3d tab  : 15sec
7th tab: 30 sec

Question 1
Can you understand what causes this performance impact?

Question 2
When we add tabs using the href attribute the easyui builds the components that are described in the markup although it is an ajax call.
To be more precise when addTab is called and server responds with <input  class="easyui-datebox"> then easy ui creates a datebox.
The same does not happen when we make an ajax call and append markup to dom. Then we have to explicitly make the datebox in javascript.
So is it possible that easyui when we call addTab recreates all the components in all tabs so that causes the performance impact?

Question 3
If I use unique ids for the elements of each tab will this cause a performance imporevement? Now as it is we have many elements with
the same id each of them exists in a separate tab

Regards
Michalis

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 30, 2013, 06:20:07 PM »

When calling 'add' method to add a new tab panel, the panel become selected by default. If a tab panel is selected, its href content will be loaded and parsed. This cause some performance losing if adding too many tab panels with many components.
To get more better performance, please use delay loading tech, i.e. set 'selected' property to false.
Code:
var t = $('#selectorX');
for(var i=0; i<10; i++){
  t.tabs('add', {
    title: 'title'+i,
    href: '...',
    selected:false
  });
}

If load an external page to a <div> element, please use $.parser.parse method to parse its components after loaded.
Code:
<div id="cc"></div>
$.get(...,function(data){
  $('#cc').html(data);
  $.parser.parse($('#cc'));
});
Logged
edjeasyui
Newbie
*
Posts: 8


View Profile
« Reply #2 on: December 02, 2013, 05:33:18 AM »

Thanks a lot for the quick answer.

The question actually is why one tab loads slower when already other tabs exists in the application.
Is it cause of the rising size of the DOM?




Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: December 02, 2013, 06:46:28 AM »

Adding too many components at a time may take a little while. But adding with 'selected' property set to false is quick since the contents are not loaded yet. When call 'select' method or click the tab strip to select a tab panel, its contents will be loaded via ajax calling.
Logged
edjeasyui
Newbie
*
Posts: 8


View Profile
« Reply #4 on: December 02, 2013, 07:42:18 AM »

Yes I understand this..

From profiler I figured out that the dateboxes take to much time to render.
Do you have any suggestion for reducing time for datebox rendering?

Thanks again
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: December 03, 2013, 05:48:54 PM »

To improve rendering datebox components, the better way is to share one calendar component. This feature will be available since version 1.3.5. The updated datebox plugin can be downloaded from http://www.jeasyui.com/easyui/plugins/jquery.datebox.js.
Code:
	<input class="easyui-datebox" sharedCalendar="#sc"></input>
<input class="easyui-datebox" sharedCalendar="#sc"></input>
<div id="sc" class="easyui-calendar"></div>
Logged
edjeasyui
Newbie
*
Posts: 8


View Profile
« Reply #6 on: December 09, 2013, 04:47:05 AM »

Thanks again,

I'll give it a try and I'll inform the forum about the performance improvement.

By the way when go you plan to release the 1.3.5 version?

Logged
leela
Newbie
*
Posts: 29


View Profile Email
« Reply #7 on: October 06, 2014, 12:10:42 PM »

Hi,

 I am having the same problem reported by Ed. The time it takes to open the tab is dependent on the number of tabs already open.
 It varies from 2 secs to 24 secs for the same form.

 Ed,

 Please let me know how did you solve your problem? I am already using shared calendar. Doesn't seem to help much.
 Really appreciate any answer.

Thanks,
Logged
tech_birbal
Newbie
*
Posts: 1


View Profile
« Reply #8 on: October 09, 2014, 10:37:21 PM »

Hi Leela,

which version of jeasyui you are using  Roll Eyes , these bugs are fixed in latest version of jeasyui 1.4.  Smiley

Thanks

Hi,

 I am having the same problem reported by Ed. The time it takes to open the tab is dependent on the number of tabs already open.
 It varies from 2 secs to 24 secs for the same form.

 Ed,

 Please let me know how did you solve your problem? I am already using shared calendar. Doesn't seem to help much.
 Really appreciate any answer.

Thanks,
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #9 on: October 24, 2017, 07:19:20 AM »

Unfortunately this performance problem of switching between already loaded tabs persists even with easyui 1.5.x

Demo: http://jsfiddle.net/6NXjB/26/

Click on a few "Platform Instance" tabs and then try switching between tabs "My Platforms" and "My Apps" or between "Platform 1" and "Platform 2"

I posted the problem hier: https://www.jeasyui.com/forum/index.php?topic=6921.0

As you can see there are no dateboxes rendered in the tabs; only datagrid with pagination.

Any idea to speed up switching of tabs?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!