react / react/yoga

Massive performance regression since commit fbd332d

Open
#734 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Algorithm
Dominant language
C++
Stars
18.9k
Forks
1.6k
Avg merge
1m
Merged PRs (30d)
1

Description

Report

The recent move to "OOP" patterns and code structures has heavily impacted performance as can be seen when running benchmarks:

TAG [1.8.0]
Stack with flex: median: 0.027000 ms, stddev: 0.005840 ms
Align stretch in undefined axis: median: 0.027000 ms, stddev: 0.005836 ms
Nested flex: median: 0.436000 ms, stddev: 0.067741 ms
Huge nested layout: median: 36.938000 ms, stddev: 2.847124 ms

COMMIT [fbd332d]
Stack with flex: median: 0.042000 ms, stddev: 0.007671 ms
Align stretch in undefined axis: median: 0.036000 ms, stddev: 0.009329 ms
Nested flex: median: 0.748000 ms, stddev: 0.108319 ms
Huge nested layout: median: 50.196000 ms, stddev: 3.076368 ms

TAG [1.7.0]
Stack with flex: median: 0.010000 ms, stddev: 0.006567 ms
Align stretch in undefined axis: median: 0.012000 ms, stddev: 0.002526 ms
Nested flex: median: 0.152000 ms, stddev: 0.038512 ms
Huge nested layout: median: 12.710000 ms, stddev: 1.497397 ms

As far as I understand mostly due to unnecessary copies all over the place.
I'm not sure if this is a known issue, but I suggest taking a look at it before it becomes too hard to optimize/refactor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the mentioned benchmarks and comparing TAG 1.7.0, TAG 1.8.0, and commit fbd332d. Trace the recent OOP-related changes and investigate the reported unnecessary copies; done means the regression is explained and benchmark results show the performance issue has been addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.