Office.js | excel加载项|打印excel数据渲染统计信息以进行性能分析

问题描述

我正在使用office.js,react,javascript创建excel加载项。我想打印统计数据,例如渲染1000行数据,10,000行数据,50,000和100,000行数据所花费的时间。 下面的代码用于使用范围在excel上呈现数据。

const startDate = new Date();
Excel.run(context => {
        const app = context.workbook.application;
        const sheet = context.workbook.worksheets.getItem('sheet1');
        return context.sync().then(() => {
            app.suspendApiCalculationUntilNextSync();
            const range = sheet.getRange(`A1:Z2000`); // range to print data on sheet
            range.values = outputData; // outputData is nothing but array of 1000,10K,100K rows with approx 80/100/200 columns
            range.format.autofitColumns();
            console.log(
                'time taken to render data',(new Date().getTime() - startDate.getTime()) / 1000,);
            return context.sync();
        });
    })

在WEB excel上,我可以看到下面的exceRich API耗时约5.60秒。 PFA SS。 https://excel.officeapps.live.com/x/_vti_bin/EwaInternalWebService.json/ExecuteRichApiRequest?waccluster=PUS1

enter image description here

有什么方法可以打印在WEB excel和桌面excel上呈现这些数据所花费的时间? 以及我们如何优化渲染时间。 已经尝试过使用小型小组对响应对象进行切片,但是比上面粘贴的代码花费更多的时间。 请提出建议,因为我们需要优先显示此统计信息。预先感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...