Skip to content

Reuse Java component name strings across Android mount items - #60568

Open
ide wants to merge 1 commit into
react:mainfrom
expo:@ide/android-component-name-strings
Open

ide wants to merge 1 commit into
react:mainfrom
expo:@ide/android-component-name-strings

Conversation

@ide

@ide ide commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Summary:

FabricMountingManager created a Java string with NewStringUTF for the component name of every Create mount item and every preallocated view. It now creates one string per name, keeps it as a global reference until the FabricMountingManager is destroyed, and passes that string each time.

Changelog:

[INTERNAL] [CHANGED] - Create one Java string per component name in FabricMountingManager.

Test Plan:

ReactAndroid builds, and RNTester's Release build mounts its screens on an arm64 Android 16 emulator. On that emulator, a JNI benchmark in RNTester that looks up names in the order View, View, Paragraph, View, Image, View measured a median of 81.3 to 83.9 ns per name with make_jstring and 7.1 to 7.6 ns with the cache, over three rounds of 21 samples.

`FabricMountingManager` created a Java string with `NewStringUTF` for the component name of every Create mount item and every preallocated view. It now creates one string per name, keeps it as a global reference until the `FabricMountingManager` is destroyed, and passes that string each time.

ReactAndroid builds, and RNTester's Release build mounts its screens on an arm64 Android 16 emulator. On that emulator, a JNI benchmark in RNTester that looks up names in the order View, View, Paragraph, View, Image, View measured a median of 81.3 to 83.9 ns per name with `make_jstring` and 7.1 to 7.6 ns with the cache, over three rounds of 21 samples.

Signed-off-by: James Ide <ide@expo.dev>
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Visual regression

No visual differences at 75e5b2dc9a21.

ios: no capture

@ide
ide marked this pull request as ready for review December 4, 2026 19:36

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant