ampproject / ampproject/worker-dom

Performance / React

Open
#824 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Was just taking this library for a spin with an medium size react app, just to see how well it runs. With some patching I got it rendering, but I was sad to find it significantly slower than running on the main thread:

![image](https://user-images.githubusercontent.com/12100/78116209-d270b580-73b8-11ea-8088-cb3bcab7311f.png)

When zoomed in:

![image](https://user-images.githubusercontent.com/12100/78116266-e3212b80-73b8-11ea-88a9-ad305f339b7c.png)

As you can see some setProperty calls are taking 15ms and the total for that render is about 2.5s, whereas on the main thread I get a total render time close to 200ms.

Heap:

![image](https://user-images.githubusercontent.com/12100/78116586-62166400-73b9-11ea-8297-d08bab2f0bf7.png)

Just curious - does this level of slowdown/overhead make sense when dealing with larger renders, or am I running into a memory or other issue?

Contributor guide

Open the contributing guide

Research direction

Reproduce the report with a medium-sized React app and compare worker rendering with main-thread rendering. Profile the reported setProperty calls and heap usage, then determine whether the slowdown is expected overhead or indicates a memory or other issue. Done means the cause is supported by measurements and the performance behavior is explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.