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

mapbox-wind 版本:1.1.1-alpha.2 性能问题 #251

Open
ParadiseWangXS opened this issue Nov 18, 2024 · 7 comments
Open

mapbox-wind 版本:1.1.1-alpha.2 性能问题 #251

ParadiseWangXS opened this issue Nov 18, 2024 · 7 comments

Comments

@ParadiseWangXS
Copy link

在这个版本下,性能似乎有些问题,在电脑端会导致电脑风扇加速,通过移动端的webview引入网页时,会导致手机发烫严重,有什么好的解决方案吗,对于性能这块

Copy link

dosubot bot commented Nov 18, 2024

@ParadiseWangXS 你好!我是Dosu,一个可以帮助你解决 bug、回答问题并成为贡献者的机器人。我会在等待人类维护者的过程中帮助你。期待能够与你合作解决问题!🤖

I found a similar open issue regarding performance problems with mapbox-wind when using globe projection, which causes page lag. The issue is that the plugin currently only supports Mercator projection, not globe projection. You can find more details in the issue discussion.

For optimizing performance, consider focusing on the WindLayerRenderer class, specifically the draw(), drawWind(), project(), unproject(), and intersectsCoordinate() methods. Optimizing these methods can help improve rendering performance. Additionally, look into optimizing the initializeParticles(), updateCommand, drawCommand, and globalDrawCommand methods, as well as the prerender() and render() methods. Techniques like batch rendering, shader optimization, and off-screen canvas rendering can also enhance performance [1][2].

To continue talking to Dosu, mention @dosu.

@sakitam-fdd
Copy link
Owner

@ParadiseWangXS 是gl版本还是canvas版本呢

@ParadiseWangXS
Copy link
Author

@sakitam-fdd ,不好意思,之前一段时间在疯狂加班,我使用的是gl版本是2.15.0
ffc614eb35af90e06a905fd3edf8c125
这个是我依赖引用,移动端是使用Flutter框架引入,webview版本:webview_flutter: ^4.5.0

@sakitam-fdd
Copy link
Owner

这个目前没有好的办法,大量粒子渲染对cpu和gpu占用都非常高

@ParadiseWangXS
Copy link
Author

我的这种情况,在2.0版本中能得到有效的解决吗,如果可以尝试使用一下2.0版本。不过十分感谢你所做的插件

@sakitam-fdd
Copy link
Owner

这个得看是使用的哪类图层了,如果是色斑图相关的话性能是有一定提升的,粒子图层性能可能不太行

  1. 在新版为了兼容多个地图引擎有一部分的胶水代码
  2. 使用方式上也有一定差别,改动可能有一定的工作量
  3. 数据组织形式有变化 https://blog.sakitam.com/wind-layer/guide/getting-started.html#_2-x-webgl-%E7%89%88%E6%9C%AC

不过有时间的话可以尝试看下,这里有相关的示例,可以先试下直接集成到 webview 看下性能 https://blog.sakitam.com/wind-layer/guide/mapbox-gl.html

@ParadiseWangXS
Copy link
Author

好的,十分感谢!!我去尝试一下

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

No branches or pull requests

2 participants