G icon indicating copy to clipboard operation
G copied to clipboard

fix: requestIdleCallback won't be triggered when animation is playing

Open HawtinZeng opened this issue 5 months ago • 6 comments

This is a Bug fix, test:browser is fine, but test:server is not ok as the result of the test in the antvis/g/master: image

HawtinZeng avatar Jun 05 '25 03:06 HawtinZeng

fixed #1948

HawtinZeng avatar Jun 05 '25 13:06 HawtinZeng

release 分支上 test:serverside 测试也是这个结果 image

HawtinZeng avatar Jun 06 '25 01:06 HawtinZeng

单测的截图是空白,是预期的嘛?

hustcc avatar Jun 06 '25 03:06 hustcc

单测的截图是空白,是预期的嘛?

这个属于已知问题,@HawtinZeng 提交的文件中删掉这个吧

wang1212 avatar Jun 06 '25 05:06 wang1212

@HawtinZeng 看更新后的代码,似乎与原有的逻辑差不多,只是多了一个 timeout 300 的参数,能确认是这个原因导致的问题吗

wang1212 avatar Jun 10 '25 03:06 wang1212

确定,开启动画的时候,浏览器线程执行繁忙,不会执行requestIdleCallback的回调,加个超时时间保证能执行。

---Original--- From: @.> Date: Tue, Jun 10, 2025 11:15 AM To: @.>; Cc: "Hawtin @.@.>; Subject: Re: [antvis/G] fix: requestIdleCallback won't be triggered whenanimation is playing (PR #1949)

wang1212 left a comment (antvis/G#1949)

@HawtinZeng 看更新后的代码,似乎与原有的逻辑差不多,只是多了一个 timeout 300 的参数,能确认是这个原因导致的问题吗

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

HawtinZeng avatar Jun 10 '25 04:06 HawtinZeng

可能对首屏加载性能造成不利影响,需要再看看如何平衡性能与该问题

wang1212 avatar Jun 27 '25 08:06 wang1212

把初始化选择器放入 web worker里?

---Original--- From: @.> Date: Fri, Jun 27, 2025 16:20 PM To: @.>; Cc: "Hawtin @.@.>; Subject: Re: [antvis/G] fix: requestIdleCallback won't be triggered whenanimation is playing (PR #1949)

wang1212 left a comment (antvis/G#1949)

可能对首屏加载性能造成不利影响,需要再看看如何平衡性能与该问题

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

HawtinZeng avatar Jun 27 '25 08:06 HawtinZeng

把初始化选择器放入 web worker里? ---Original--- From: @.> Date: Fri, Jun 27, 2025 16:20 PM To: @.>; Cc: "Hawtin @.@.>; Subject: Re: [antvis/G] fix: requestIdleCallback won't be triggered whenanimation is playing (PR #1949) wang1212 left a comment (antvis/G#1949) 可能对首屏加载性能造成不利影响,需要再看看如何平衡性能与该问题 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

当前的方案只是可能对首屏性能产生影响,同时部分浏览器目前还不支持 timeout 配置项;另外,web worker 难以适配多个环境,并且构建流程比较繁琐,不是最优方案。

wang1212 avatar Jul 08 '25 07:07 wang1212