question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RTL Performance Impact

See original GitHub issue

Greetings!

I’ve been investigating React Testing Library performance issues on a test suite in my organization. After digging I finally traced the issue to <FocusLock>. We are wrapping our modal with this and when I remove <FocusLock> from our modal component, it nearly cuts my testing time in half from 110s (83 tests total) to 50s!

I haven’t had the time to dive into this repo so unfortunately I don’t know where to begin to fix it, so I thought I’d open an issue.

What information can I give that will help? Is this a known performance issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
theKasheycommented, May 13, 2021

The new version, 2.5.1, has been released with the potential fix for this issue (#151)

You can or update focus-lock, or update underlying focus-lock(just wipe it from yarn.lock or package.lock) which brought the fix - https://github.com/theKashey/focus-lock/pull/24

1reaction
nicolasschabramcommented, Jan 6, 2021

In our case, we’ve started seeing a test-performance regression after upgrading our create-react-app application to v4. The impact on the entire test suite was quite dramatic, something on the order of 4 to 5 times slower. We’re using React Testing Library as well. Judging from the profiler, most of that time is spent in react-focus-lock’s activateTrap() function: 15 seconds on our slowest test! That test is probably rendering a bit too much for its own good, but nothing crazy (some tables and a form in a dialog on top).

image

We’re consuming react-focus-lock via @reach/dialog, so we worked around the issue by disabling it in test environments like this:

 <DialogOverlay dangerouslyBypassFocusLock={process.env.NODE_ENV === "test"}>

CRA v4 came with jest and jsdom updates. Maybe something about those new versions doesn’t play well with react-focus-lock?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Measuring Performance with RTL or HLS Monitors - Xilinx
You can use custom RTL or HLS kernels to count the cycles elapsed between the start and end of AXI4-Stream transactions. In the...
Read more >
Physical Lint: Physical Quality Metrics For Your RTL
The quality of the logic structures generated from RTL has a direct impact on the number of design iterations required to close a...
Read more >
How to Measure & Optimize System Performance of a ...
Once performance characterization has been satisfactorily completed the second step of the process is to build more realistic use-cases that ...
Read more >
Improving Design Power and Performance with RTL Architect
Exploring the impact of RTL on implementation PPA has traditionally been very difficult since it was hard to connect the results to the...
Read more >
RTL Validation Methodology | Download Scientific Diagram
... this work we target two platforms for validating the performance model: cycle-accurate RTL model simulation and simulation on a hardware emulator. Figure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found