-
-
Notifications
You must be signed in to change notification settings - Fork 648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 每次初始化表格渲染时,会调用四次Sum函数,每次选择单元格会执行两次Sum函数 #1333
Comments
Initial list
Affected packages and versionsdev Reproduction steps
//univer.createUniverSheet(DEFAULT_WORKBOOK_DATA_DEMO);
univer.createUniverSheet({});
*Additional instructions: Expected behavior
Actual behavior
Running environmentChrome operating systemmacOS Build toolsesbuild, Vite |
@yuhongz 帮忙看看是否有status bar 的计算是否有优化空间。 |
The formula calculation does currently have a problem with too many calls, and will be optimized later. @yuhongz Please help me see if there is room for optimization in the calculation of the status bar. |
发现不必要的计算,已在这个 PR #1353 优化掉了。 |
Unnecessary calculations were found and have been optimized away in this PR #1353. |
但是status bar是公共能力,如果表格数据特别多的情况下,应该会产生CPU资源浪费和性能问题(即使计算都放到Web Worker中,也可能产生性能问题,看看是否需要构造一个大数据量的表格来做性能测试吧)。 |
However, the status bar is a public capability. If there is a lot of table data, it may cause a waste of CPU resources and performance problems (even if the calculations are all done in the Web Worker, performance problems may occur. Check whether you need to construct a large amount of data. Use the form to do performance testing). |
初始清单
受影响的包和版本
dev
复现步骤
examples/src/sheets/main.ts
文件,初始化空白sheet,变更代码如下:pnpm dev:demo
命令启动开发服务http://localhost:3002
,并在packages/engine-formula/src/functions/math/sum/index.ts
文件中的第24行打上断点我通过查看调用堆栈,发现是在
packages/sheets-ui/src/controllers/status-bar.controller.ts
文件的第145行触发的。预期行为
1
次Sum函数1
次Sum函数不执行
Sum函数1
次Sum函数`实际行为
4
次Sum函数2
次Sum函数2
次Sum函数2
次Sum函数运行环境
Chrome
操作系统
macOS
构建工具
esbuild, Vite
The text was updated successfully, but these errors were encountered: