Skip to content
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

用SVG做白板性能会不会有问题? #564

Open
aokaywe opened this issue Sep 13, 2023 · 2 comments
Open

用SVG做白板性能会不会有问题? #564

aokaywe opened this issue Sep 13, 2023 · 2 comments

Comments

@aokaywe
Copy link

aokaywe commented Sep 13, 2023

实测1500个脑图节点,目前需要8S左右。
@pubuzhixing8 @WBbug

@pubuzhixing8
Copy link
Collaborator

@aokaywe 我们目前测试的也是这个表现,而且因为我们的导图节点文字目前使用的是富文本编辑器组件(每一个节点都是一个独立的富文本编辑器),这个编辑器器组件测试发现稍微有点影响性能,这块还有一定的优化空间。

@aokaywe
Copy link
Author

aokaywe commented Sep 19, 2023

@pubuzhixing8 性能这块的方案可以交流下

  1. 基于svg,感觉很难提升,受限于dom效率,不知道能不能使用类似于虚拟滚动的机制,但是在脑图缩小的时候,dom节点依然很多;有没有啥思路可以提供?
  2. 基于原生canvas,有konva、pixijs之类的底层库,但测试下来,canvas的文字显示性能极低。研究下来,各大基于canvas脑图,只有幕布性能不错,5000个节点也不会卡顿,不知道采用了什么机制
  3. 基于WebAssembly,开源的解决方案有Skia + WebAssembly,国内的白板产品boardmix可能就是这种机制;国外figma也是基于wasm的

另外,富文本编辑器推荐tiptap,但也厚重,用在脑图中,可能得弄一个轻量的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants