cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Chrome Warning

Open mumua666 opened this issue 1 year ago • 3 comments

What happened?

When I use CesiumJS 1.103 to implement a Web 3D application, Chrome prints many warnings like: [Violation] ‘requestAnimationFrame’ handler took 584ms; [Violation] Added non-passive event listener to a scroll-blocking ‘mousewheel’ event. Consider marking event handler as ‘passive’ to make the page more responsive. See Passive event listeners - Chrome Platform Status 267;[Violation] ‘message’ handler took 213ms.

Reproduction steps

1.use CesiumJS to implement a Web 3D application 2.Browse in Chrome 3.Open the dev-tools ...

Sandcastle example

No response

Environment

Browser: Chrome Version 126.0.6478.126 (Official Build) (64-bit) CesiumJS Version: 1.103 Operating System: Ubuntu 22.04 LTS

mumua666 avatar Jul 10 '24 05:07 mumua666

Hi @mumua666, I'm not able to reproduce this warning.

Would you be able to include a Sandcastle example that replicates the issue? That would help us give us more context to determine the issue. Thanks!

ggetz avatar Jul 10 '24 15:07 ggetz

Ok, Maybe I can send you my working project, which is implemented by Vue2 + CesiumJS1.103. Here the source code. By the way, this is a commercial project, and please keep in mind not leaking the source code. Many thanks.

------------------ 原始邮件 ------------------ 发件人: "CesiumGS/cesium" @.>; 发送时间: 2024年7月10日(星期三) 晚上11:23 @.>; @.@.>; 主题: Re: [CesiumGS/cesium] Chrome Warning (Issue #12076)

Hi @mumua666, I'm not able to reproduce this warning.

Would you be able to include a Sandcastle example that replicates the issue? That would help us give us more context to determine the issue. Thanks!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

木木 @.***

深圳大学 学生

从QQ邮箱发来的超大附件

WuyiMine.zip (472.33M, 2024年08月10日 03:06 到期)进入下载页面:https://mail.qq.com/cgi-bin/ftnExs_download?k=71636234cf9c4ad18030adf24231021c48175257560405011d535403511c550a02014f000557511e0656040d57025507525a0004643d3064451a0b790d5f551d4a0a123459&t=exs_ftn_download&code=0cb4d103

mumua666 avatar Jul 10 '24 19:07 mumua666

Hi @mumua666, could you create a minimal code example using Sandcastle?

ggetz avatar Aug 15 '24 14:08 ggetz

@ggetz I am also experiencing this issue. I am getting both of the following warnings in large quantity when scrolling around the map and interacting with entities:

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

[Violation] 'requestAnimationFrame' handler took 142ms

The performance impact is that my scrolling is quite laggy and it makes the map hard to use.

I have determined that the root cause is the event handlers in CzmlDataSource- MOUSE_MOVE and LEFT_CLICK ScreenSpaceEventTypes.

I believe this issue could be fixed by making these event listeners passive (see explanation here: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md), but as far as I know there is no way to make event listeners passive within the cesium map, since only the Cesium API's (and not raw javascript) can be used to create event listeners.

Is there any plan to enhance the Cesium API's to allow for passive event listeners?

I will work on making a reproducible example using Sandcastle for you.

c3-barrettnelson avatar Nov 26 '24 05:11 c3-barrettnelson