[0.88] Compile React Native C/C++ at -O2 on iOS to match Android
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- android, c, cmake, cpp, git, ios, objective-c, react-native, swift
- Domain
- build-system, mobile
Research direction
Start by reviewing commit 60c817e9256abaea212ebd826d18043d4f1c5109 and the upstream change react/react-native#59226. Trace the Release optimization settings for React Native's iOS frameworks, CocoaPods source builds, Yoga, glog, and the SwiftPM codegen package. Done means the 0.88 branch applies the stated -O2 settings across those build paths while leaving the listed unaffected code unchanged.
Written by the indexing model from the issue text.
Description
Target Branch
0.88
Link to commit or PR to be picked
https://github.com/react/react-native/commit/60c817e9256abaea212ebd826d18043d4f1c5109
Description
Picks react/react-native#59226 (merged to main as 60c817e) for 0.88.1.
On iOS, React Native's C, C++ and Objective-C code is compiled with -Os in Release (Xcode's default), while Android uses -O2. This change sets GCC_OPTIMIZATION_LEVEL = 2 for Release builds of React Native's own code on iOS, and builds Yoga and glog at -O2 in all configurations, matching Android. It covers the prebuilt React.xcframework and ReactNativeDependencies.xcframework, CocoaPods builds from source, and the SwiftPM codegen package. Hermes, Swift code, community library pods and app pods are not affected.
Impact: In a layout benchmark, Yoga layout takes 21–54% less time in Release and about 94% less time in Debug. The community has reported measurable app-level gains (https://github.com/bluesky-social/social-app/pull/12061). Apps cannot apply this themselves when they use the prebuilt React Native frameworks, so it needs to ship in a React Native release.
Trade-off: The stripped React.framework binary grows by about 6.2%. Apps that want the old behaviour can set GCC_OPTIMIZATION_LEVEL back to s in their post_install, after react_native_post_install.
- Dominant language
- No language data
- Stars
- 429
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reactwg/react-native-releases
-
Type Pick Request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
reactwg/react-native-releases#1456 · 1 comment ·
-
Type Pick Request
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
reactwg/react-native-releases#1435 · 1 comment ·
-
Type Pick Request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
reactwg/react-native-releases#1427 · 1 comment ·
-
Type Pick Request
Difficulty 1/5 Under an hour Newbie friendliness 78/100
reactwg/react-native-releases#1349 · 1 comment · 1 reaction ·
-
Type Pick Request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
reactwg/react-native-releases#1326 · 1 comment ·
All issues in reactwg/react-native-releases
Similar issues
-
package-lock.json : les binaires natifs macOS et Linux de unrs-resolver ont disparu depuis #1823Openbug dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AxaFrance/design-system#2064 ·
Maintainers usually reply within 3 days
-
The `next-js` export condition isn't set, so packages like next-sanity load their non-Next buildOpen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
cloudflare/vinext#4302 ·
Maintainers usually reply within 1 day
-
agent/ci-maintainer ci good first issue help wanted stage/010-actionable
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
cncf/endusers#1890 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
arvidn/libtorrent#9047 ·
Maintainers usually reply within 1 day
-
`dir.c` (0.10.17) uses `NAME_MAX` without including `<limits.h>`, so musl targets do not compileOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100