Posted 28 January 2022, 5:31 am EST
Dear support,
I recently had some performance issues with Worksheet containing a big number of columns and the autoFitColumn method.
What we are doing is:
const colCount = sheet.getColumnCount()
for (let i = 0; i < colCount; i++) {
if (i > 0) {
sheet.autoFitColumn(i)
}
}
I’m wondering if we could apply the autoFitColumn for a CellRange and run it once like it could be done with other methods such as setStyle with the -1 values 'cause looping just to “set the width of each column” seems a bit too hardcoded.
Just this operation takes around 5s (5 seconds is an average from a bunch of performance tests) so I’m wondering if you have some memory leak within the method itself or it’s just need some optimisation.
I’m not able to build a sample for you as this link: https://demos.componentone.com/Spread/spreadSamplesEvalKey.js has been removed so there is no way to include a license in a sandbox:
