-
Notifications
You must be signed in to change notification settings - Fork 24.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Certain styles applied together peg CPU #824
Comments
@lwansbrough @vjeux and I looked into this in irc, fix for anyone else that comes across it is to use |
The infinite loop is caused inside of the layout algorithm: https://github.com/facebook/css-layout if anyone is interesting in debugging it |
It appears |
…RN team to pull upstream changes which fix the infinite loop
Any news on this? |
but it also a bug, when I run , the app cpu hit 100% |
Summary: `YGRoundValueToPixelGrid` currently rounds negative numbers incorrectly. For example: ``` YGRoundValueToPixelGrid(-2.2, 1.0, /* ceil */ false, /* floor */ true) = -2.0 ``` However, that operation is supposed to take the floor of the number so the result should acutally be `-3.0`. There's a detailed comment in `YGRoundValueToPixelGrid` about the fix and why it works. A symptom that manifested because of this bug is that text nodes could get smaller and smaller on each layout pass. For details see facebook/yoga#824. Fixes #824 Adam Comella Microsoft Corp. Pull Request resolved: facebook/yoga#825 Reviewed By: priteshrnandgaonkar Differential Revision: D10282064 Pulled By: shergin fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
Summary: `YGRoundValueToPixelGrid` currently rounds negative numbers incorrectly. For example: ``` YGRoundValueToPixelGrid(-2.2, 1.0, /* ceil */ false, /* floor */ true) = -2.0 ``` However, that operation is supposed to take the floor of the number so the result should acutally be `-3.0`. There's a detailed comment in `YGRoundValueToPixelGrid` about the fix and why it works. A symptom that manifested because of this bug is that text nodes could get smaller and smaller on each layout pass. For details see facebook/yoga#824. Fixes #824 Adam Comella Microsoft Corp. Pull Request resolved: facebook/yoga#825 Reviewed By: priteshrnandgaonkar Differential Revision: D10282064 Pulled By: shergin fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
While working on my markdown module, I ran into a situation where my simulator CPU would jump to 160%+ and would (obviously) freeze the app. I found this behaviour particularly strange because the only thing I was doing was inserting React elements into the virtual DOM.
I thought perhaps there was a parsing bug that was causing a huge tree to be rendered, but upon further investigation I found I could repeat the issue with plain text inside my Markdown tag. The issue was only coming up after a certain number of letters were entered. That initial assumption was wrong though.
What seems to be happening is when a
Text
element exceeds the available width of its containingView
, a bug causes the app to freeze up. This is more difficult to explain than it is to show, here's the code: (For reference, I was using0.3.11
the iPhone 6 simulator, so the 375 width is relevant.)The text was updated successfully, but these errors were encountered: