EasyUI Forum
May 04, 2024, 04:41:05 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Datagrid performance  (Read 7312 times)
sectioni
Jr. Member
**
Posts: 67


View Profile
« on: August 10, 2017, 03:31:50 AM »

Hi,

I have disabled the following in my datagrid:
            nowrap             : false,
            fit                : false,
            fitColumns         : false,
            autoRowHeight      : false

My columns all have a width defined, and I am loading 700 rows.

Performance analysis shows that rendering is responsible for 5.6 seconds lag.

getClientRects => $.fn._outerWidth => getCellWidth => .each => autoSizeColumn is responsible for most of it.
What is the reason this function is running?

Thank you.
« Last Edit: August 10, 2017, 03:37:52 AM by sectioni » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: August 11, 2017, 12:07:16 AM »

Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=material&dir=ltr&pitem=Large%20Data&sort=

It loads 1000 rows at a time quickly.
Logged
sectioni
Jr. Member
**
Posts: 67


View Profile
« Reply #2 on: August 16, 2017, 07:37:49 AM »

Hi,

I managed to find the reason!

If i set my columns programmatically, and I have a column that's hidden, and it's width is set to 0 or no width parameter at all, then rendering is 3-4 times slower on Chrome, and about 1.5 slower on Firefox

You can test it here: https://jsfiddle.net/xwyq3ehd/14/

Run the script, Click Load, Watch the time.
Then change the width value on the first column to any number, Run the script, Click Load and watch the time again.
« Last Edit: August 16, 2017, 07:56:16 AM by sectioni » Logged
juancitop
Newbie
*
Posts: 22


View Profile Email
« Reply #3 on: August 16, 2017, 09:22:04 AM »

The same happens defining the grid in html markups.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #4 on: August 16, 2017, 07:30:21 PM »

When loading large dataset, you should set 'width' property for each columns to get more loading performance.
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!