Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jinleili committed May 16, 2024
1 parent 30f6551 commit 5d09f2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Engine 放进 Web Worker 后与主线程交互的通信时延与性能验证
1. 主线程与 Worker 之间事件通信成本是否会很高。
2. 异步的 pick 接口是否会导致用户交互体验变差。
3. 主线程阻塞对 事件/ worker 的影响。
4. 鼠标事件,onmessage 及 render 内阻塞对体验上的影响。

**针对上面验证点的设计:**

Expand All @@ -17,7 +18,13 @@ Engine 放进 Web Worker 后与主线程交互的通信时延与性能验证
3. 将结果从 engine 发给 worker -> 
4. 由 worker postMsg 给主线程 -> 
5. 主线程再 postMsg 给 worker 执行需要的 **选中/高亮**
3. 模拟了主线程阻塞的场景,可以控制单帧阻塞时长,同时左上角有一个**主线程卡顿指示器**便于观察阻塞结果
3. 模拟了主线程阻塞的场景,可以控制单帧阻塞时长,同时左上角有一个**主线程卡顿指示器**便于观察阻塞结果;
4. 界面中同时提供了 主线程与 Worker 线程 两个运行实例,方便直观对比;
5. 模拟了 mousemove, onmessage 及 render 内阻塞的场景;
6. 提供了按住鼠标左键拖动场景对象的功能;
7. 模拟了工具类 App 的帧渲染逻辑:关闭场景动画后,帧渲染就完全由鼠标事件驱动;

![Bevy in Web Worker](./screenshot.png)

## 代码运行

Expand Down
Binary file added screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5d09f2c

Please sign in to comment.