Open own3mall opened 6 years ago
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):
@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?
@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
@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.
@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.
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: