Skip to content

Enable INTERPROCEDURAL_OPTIMIZATION for libhermes.so in OSS #50581

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

Closed
wants to merge 1 commit into from

Conversation

cortinico
Copy link
Contributor

Summary:
This enables INTERPROCEDURAL_OPTIMIZATION for Hermes in OSS, similar to how we did for libreactnative.so

Changelog:
[Internal] [Changed] -

Differential Revision: D72696879

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Apr 9, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72696879

…#50581)

Summary:

This enables INTERPROCEDURAL_OPTIMIZATION for Hermes in OSS, similar to how we did for libreactnative.so

Changelog:
[Internal] [Changed] -

Differential Revision: D72696879
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D72696879

facebook-github-bot pushed a commit that referenced this pull request Apr 11, 2025
…ermes.so in OSS

Summary:
PR is here #50581

This enables INTERPROCEDURAL_OPTIMIZATION for Hermes in OSS, similar to how we did for libreactnative.so
I also had to bump CMake to 3.30.x to unblock the build failure with `-fuse-ld=gold`

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D72696879

fbshipit-source-id: e842f6cdf41f6936ef4baeb70e4833a1a0c2d19b
@kewde
Copy link
Contributor

kewde commented Apr 18, 2025

@cortinico

Thanks for this PR! What a happy accident, thanks for the commit comment, helped me out why the gold linker was being used somehow in my attempt to enable LTO 😅

Did you happen to run any performance tests for this PR, did enabling LTO have a considerable impact on the performance?

uffoltzl pushed a commit to uffoltzl/react-native that referenced this pull request Apr 18, 2025
…ermes.so in OSS

Summary:
PR is here facebook#50581

This enables INTERPROCEDURAL_OPTIMIZATION for Hermes in OSS, similar to how we did for libreactnative.so
I also had to bump CMake to 3.30.x to unblock the build failure with `-fuse-ld=gold`

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D72696879

fbshipit-source-id: e842f6cdf41f6936ef4baeb70e4833a1a0c2d19b
@cortinico
Copy link
Contributor Author

Did you happen to run any performance tests for this PR, did enabling LTO have a considerable impact on the performance?

Nope I will run it this week and share an updates if we have significant results

@cortinico
Copy link
Contributor Author

So this will have us ~1.2Mb on all the Android release APKs (huge!):

Screenshot 2025-04-22 at 17 17 46

Plus some marginal wins in startup time:

# BEFORE

Pixel Fold - 15 Tests 0/1 completed. (0 skipped) (0 failed)

RNTesterStartupBenchmark_startup
timeToFullDisplayMs      min 430.4,   median 474.8,   max 523.4
timeToInitialDisplayMs   min 206.6,   median 240.5,   max 264.2


# AFTER

Pixel Fold - 15 Tests 0/1 completed. (0 skipped) (0 failed)

RNTesterStartupBenchmark_startup
timeToFullDisplayMs      min 423.5,   median 468.4,   max 556.9
timeToInitialDisplayMs   min 213.5,   median 235.2,   max 308.6

@cortinico
Copy link
Contributor Author

Closing as this has merged already in main: 5ef6856

@cortinico cortinico closed this Apr 23, 2025
@cortinico cortinico added the Merged This PR has been merged. label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants