-
-
Notifications
You must be signed in to change notification settings - Fork 28
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: Interface freezes after any repositioning #108
Comments
Another example bug.mp4 |
Hello. It’s very difficult to help you with anything, since everything works for me without any freezes 2025-01-15.16.03.29.mov |
Hi. @siarheihuzarevich, thank you for your quick response. It's happening when I add more than 15-20 connections. If you check my stackblitz demo you can see the same issue. |
OK. I'll try to figure out your problem |
I looked at your example from stackblitz and also added a lot of nodes and connections to DB-Management example and everything works fine. Below I show a video of an example specially created for the test. It has 31 connections that are recalculated simultaneously and everything works fine 2025-01-15.23.10.28.mov |
Can you drag another node after dragging the first node? |
Yes, and all work fine. |
Hi! There is, of course, the possibility that my computer’s performance is higher, which allows the recalculations to happen quickly. That said, I can assure you that the library’s calculations are as optimized as I could make them at this stage. When a node is moved, only the necessary recalculations are performed, and no redundant updates are triggered. Before and after the movement, the system also performs only the required operations. However, I acknowledge that these calculations might still be heavy because they involve numerous vector addition and subtraction operations. The only way to significantly improve performance further would be to move some of this code to WebAssembly. This is something I’ve already planned, but implementing it will take a couple of months, as it’s not a quick task. In the meantime, could you confirm: |
Hi. I use M1 MacBook Pro 16 GB and desktop setup system (ryzen 5900x processor) 32 GB. Also my firefox profiler output: https://share.firefox.dev/3WhPo2z (recorded with 222 nodes and 222 edges) There is no problem while dragging nodes but after dragend or a similar event, it is trying to calculate all paths again (I guess). |
And some logs from f-flow/projects/f-flow/src/f-draggable/f-draggable.directive.ts Lines 158 to 177 in fa3327f
My timer logs: dnd-end-events-preview.mp4 |
@relliv Hello! Thank you for providing the profiler output and your detailed environment setup. It’s clear that your systems are powerful, which rules out performance limitations on the hardware side. I’ve made some optimizations in version 17.0.7, which you can try — it might improve the performance slightly. However, I want to mention that I have never tested the library specifically for Firefox. During development, I primarily focus on Safari and Chrome, as these are my main target browsers. If you continue experiencing issues, I would recommend checking the performance in one of these browsers to see if the behavior differs. Please let me know how it goes with the new version and whether the optimizations make a difference! Looking forward to your feedback! |
@relliv also you can check this stress test https://flow.foblex.com/examples/stress-test-with-connections |
@siarheihuzarevich I'm sorry, I had to update @foblex/2d too. X [ERROR] No matching export in "node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__rx_au7zdmvc6wlcok5kyhhrmnjsem/node_modules/@foblex/2d/fesm2015/foblex-2d.js" for import "findClosestAlignment"
node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__7yr752orykhiy7gyprdlhpshvy/node_modules/@foblex/flow/fesm2022/foblex-flow.mjs:3:177:
3 │ ... adjustRectToMinSize, findClosestAlignment, setRectToViewBox } f...
╵ ~~~~~~~~~~~~~~~~~~~~
C:\Users\e9396\OneDrive\Desktop\gh\nn\ngeen-platform\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1472
let error = new Error(text);
^
Error: Build failed with 1 error:
node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__7yr752orykhiy7gyprdlhpshvy/node_modules/@foblex/flow/fesm2022/foblex-flow.mjs:3:177: ERROR: No matching export in "node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]__rx_au7zdmvc6wlcok5kyhhrmnjsem/node_modules/@foblex/2d/fesm2015/foblex-2d.js" for import "findClosestAlignment"
at failureErrorWithLog (C:\Users\e9396\OneDrive\Desktop\gh\nn\ngeen-platform\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1472:15)
at C:\Users\e9396\OneDrive\Desktop\gh\nn\ngeen-platform\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:945:25
at C:\Users\e9396\OneDrive\Desktop\gh\nn\ngeen-platform\node_modules\.pnpm\e[email protected]\node_modules\esbuild\lib\main.js:1353:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [Getter/Setter],
warnings: [Getter/Setter]
}
Node.js v21.7.3 |
Yes. You need to update all dependencies of flow |
I'm not sure but I don't see any improvement. I'm testing with Opera, Brave, Edge, and Firefox. Still, there is a 1-1.5 second delay/freeze after DND with 25 nodes and 25 random edges, except Firefox. Chromium-based browsers are still laggy. BTW, the new stress test is working fine with all browsers. I'll keep investigating this issue. Many many thanks :) |
I also recommend disabling one plugin at a time, such as line alignment, minimap, connection text, to see how they affect performance. |
@relliv I updated the version to 17.0.8. Please update as I have made onPointerUp much faster |
Description
UI freezes when I drag a node for a while.
I created the test project here.
https://stackblitz.com/edit/stackblitz-starters-ykgm76ue?file=src%2Fmain.ts
Steps to Reproduce
Expected Result
After repositioning, the library calculates and re-draws entire connection lines, causing UI freeze effects. I watch dom and SVG path data, it's re-rendering with any reposition action.
Actual Result
Zero lag or hacky solution. I think this problem is a huge issue for UX. In this case it should update only related connections, not all.
Environment Details
Similar to the provided stackblitz example.
Screenshots or Videos
Kayit.2025-01-15.041143.mp4
Additional Context
Thanks!
The text was updated successfully, but these errors were encountered: