Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

6000+ Rows or Many Row Table = Browser Crash / Non-Responsive Script #155

Open
own3mall opened this issue Nov 7, 2018 · 5 comments
Open

Comments

@own3mall
Copy link

own3mall commented Nov 7, 2018

If you have a large table with tons of rows, the TableExport script seems to freeze and causes the browser to crash due to a slow and non-responsive script.

This fiddle isn't 6000 rows, but notice how slow it is to initialize TableExport?

http://jsfiddle.net/dpt9kx8a/4/

I am running into a scenario where I have 6000+ rows displayed for one of my reports, and the browser crashes. If I stop TableExport from running, the page works and is able to scroll through all of those rows, so I know for sure it's TableExport causing the slowdown and crash.

When I stop the script in Firefox, I get the following console output:

Error: Script terminated by timeout at:
_matches/<@http://localhost/Scripts/tableexport/js/tableexport.js:1053:28
_matches@http://localhost/Scripts/tableexport/js/tableexport.js:1052:20
@own3mall
Copy link
Author

own3mall commented Dec 4, 2018

To be honest, the way this plugin works is completely flawed. No initialization should be done on the table until the button is clicked on to export the data.

A lot of table columns can be changed dynamically by most apps (shown and hidden for example). As such, rather than taking a brute force approach and trying to initialize and prepare the plugin for thousands of rows with tons of columns, the script should only do what it needs to when called. That is a big problem with this plugin.

This plugin is much faster and more efficient with large data sets (even though the author claims his plugin is not as advanced as yours):

https://github.com/rainabba/jquery-table2excel

@MikeAlhayek
Copy link

@clarketm have you looked into this issue? I am facing the same issue with large data in version 5.1.0. Is it possible to do partial initialization to add the button but then delay everything else? This cause a delay even if the user is not intended export the data. Any idea?

@MikeAlhayek
Copy link

@own3mall Pull request #195 fixed this issue, if the pull-request is rejected, you can use this fork which has the fix https://github.com/CrestApps/TableExport

@own3mall
Copy link
Author

own3mall commented Jan 8, 2020

@CrestApps Thanks for doing this! I've mainly been using https://github.com/rainabba/jquery-table2excel since it is extremely performant, but I'll see what your version does in the jsfiddle.

@own3mall
Copy link
Author

own3mall commented Jan 9, 2020

@CrestApps Yep, it's much better now. https://jsfiddle.net/dacLe20j/

You can't really measure performance using jsfiddle, so I loaded both samples and ran them locally. With the old version of the code, the DOM takes 9.30 seconds to load. With your code, the DOM is loaded in 900MS. 10x improvement. Thanks for doing this.

@CrestApps - Updated comment now that I've done the real testing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants