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.

Example causes CPU to go to max

See original GitHub issue

Hey y’all. Really appreciate these libraries!

I’ve been trying to get the example to work but unfortunately when I run it it causes the CPU to go to 200% in the simulator. To try to isolate the issue I’ve created a brand new expo project and copied the example, but it still causes the CPU to spike after swiping the first item.

I’ve included the project.json and a video showing the behavior below.

Any guidance on how to understand what’s happening here? Thanks

Package.json

{
  "name": "test-proj",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "expo": "~46.0.6",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.4",
    "react-native-draggable-flatlist": "^3.1.2",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-reanimated": "^2.9.1",
    "react-native-swipeable-item": "^2.0.7",
    "react-native-web": "~0.18.7"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~18.0.14",
    "@types/react-native": "~0.69.1",
    "typescript": "~4.3.5"
  },
  "private": true
}

Video

https://user-images.githubusercontent.com/8898/184342414-5a917ab5-d890-4603-b0a4-6c8e16522829.mp4

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
GabrielDierkscommented, Aug 16, 2022

I can confirm it is working on 2.0.6! But I have the same issue with 2.0.7

The issue seems to be caused by this function:

if (open) { [...itemRefs.current.entries()].forEach(([id, ref]) => { if (id !== item.id && ref) ref.close(); });

0reactions
computerjazzcommented, Sep 10, 2022

@jmif If you can provide a repro via an expo snack I’ll take a look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix High CPU Usage - Intel
Find out all the reasons why your PC displays high CPU usage. Our step-by-step guide will show you how to fix your CPU...
Read more >
What is CPU usage, and how to fix high CPU usage
If your PC has slowed down, high CPU usage may be the cause. In this guide, we will show you how to check...
Read more >
How to Lower CPU Usage: Common Causes & Tips - N-able
The symptoms of high CPU usage are familiar: the cursor moves jerkily and slowly, and applications begin to lag or shut down.
Read more >
How to Fix High CPU Usage (with Pictures) - wikiHow
1. Press .Ctrl+ Shift+Esc to open the Task Manager. This is a utility that monitors and reports on all of the processes and...
Read more >
Why won't my CPU operate at its max potential ... - Super User
In the absolutely worst case scenario, your task manager may only show 50% usage because it counts hyperthreaded cores in its graphs, when...
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