Comments (7)
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Initial list
- Is this really a problem?
- I've searched Github Issues but haven't found any similar issues.
Affected packages and versions
dev
Reproduction steps
- Modify the
examples/src/sheets/main.ts
file, initialize the blank sheet, and change the code as follows:
//univer.createUniverSheet(DEFAULT_WORKBOOK_DATA_DEMO);
univer.createUniverSheet({});
- Run the
pnpm dev:demo
command to start the development service - Open the browser, visit
http://localhost:3002
, and put a breakpoint on line 24 in thepackages/engine-formula/src/functions/math/sum/index.ts
file - Refresh the current page and find that the sum function has been executed four times.
- When you click a cell to switch selections, add a new worksheet, or modify the style of any cell (not the value), the Sum function will be executed twice.
*Additional instructions:
By looking at the call stack, I found that it was triggered on line 145 of the packages/sheets-ui/src/controllers/status-bar.controller.ts
file.
Expected behavior
- Only execute the Sum function
1
times during initialization - Execute the Sum function
1
times when switching worksheets - When only changing the selection and cell styles, the Sum function is not executed.
- When modifying the cell value, execute the Sum function
1
times
Actual behavior
- The Sum function was executed
4
times during initialization. - The Sum function was executed
2
times when switching worksheets. - When modifying the selection and cell style, the Sum function was executed
2
times - When modifying the cell value, the Sum function was executed
2
times
Running environment
Chrome
operating system
macOS
Build tools
esbuild, Vite
from univer.
@yuhongz 帮忙看看是否有status bar 的计算是否有优化空间。
from univer.
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
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.
from univer.
发现不必要的计算,已在这个 PR #1353 优化掉了。
修改样式会导致重新计算是在预期中的行为,因为修改样式和修改值都是使用 SetRangeValueMutation,要区分开来需要用更细粒度的比较,也会带来性能负担
from univer.
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Unnecessary calculations were found and have been optimized away in this PR #1353.
Modifying the style will cause recalculation, which is expected behavior, because both modifying the style and modifying the value use SetRangeValueMutation. To distinguish them, you need to use a more fine-grained comparison, which will also bring a performance burden.
from univer.
发现不必要的计算,已在这个 PR #1353 优化掉了。 修改样式会导致重新计算是在预期中的行为,因为修改样式和修改值都是使用 SetRangeValueMutation,要区分开来需要用更细粒度的比较,也会带来性能负担
但是status bar是公共能力,如果表格数据特别多的情况下,应该会产生CPU资源浪费和性能问题(即使计算都放到Web Worker中,也可能产生性能问题,看看是否需要构造一个大数据量的表格来做性能测试吧)。
from univer.
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Unnecessary calculations were found and have been optimized in this PR #1353. Modifying the style will cause recalculation, which is expected behavior, because both modifying the style and modifying the value use SetRangeValueMutation. To distinguish them, you need to use a more fine-grained comparison, which will also bring a performance burden.
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).
from univer.
Related Issues (20)
- [Feature] Math Formula NETWORKDAYS.INTL WEEKDAY CHOOSE
- I want to modify the top of the sheet without changing the source code, such as the position of the summation formula icon, or modify the content in the right-click menu. Is there such a plug-in? I think Univer/UI can do it, but I don’t quite understand it. HOT 2
- [Bug] low node version depends error "export 'bufferTime' (imported as 'Ei') was not found in 'rxjs' HOT 7
- [Feature] Existing tool methods can support dynamic configuration. HOT 2
- [Bug] InsertRowCommand not work, cellValue not showing
- [Bug] How to disable the context menu HOT 1
- [Feature] Workbook read only HOT 2
- [Bug] Can not recovery display the hidden worksheet
- [Bug] How to distinguish the click and right-click command
- [Bug] add custom-function to vue3 HOT 2
- [Bug] When copying formula data to another sheet, an error occurs.
- [Feature] 关于csv格式的大文件导入的速度优化
- [Feature] 树形表格支持吗 HOT 1
- [Bug] When there is a formula in a row, the row cannot be deleted successfully. HOT 1
- [Bug] When there is a formula in a row, if you delete a row, the formula will not be deleted. HOT 2
- [Bug] Formula entry remains stuck when clicking another cell
- Fix
- [Feature] Custom formula supports asynchronous requests HOT 1
- Provide default values for the properties of the `IStyleData` object[Feature] HOT 2
- Is it possible to provide a global monitoring function to transmit the latest overall table data when the table data changes? [Feature] HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from univer.