Decrease amount of requests send to Maven repos (#57765) - #57765
Open
coado wants to merge 1 commit into
Open
Conversation
|
@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D114341998. |
Summary: The Ruby scripts that resolve prebuilt artifacts (ReactNativeCore, ReactNativeDependencies, hermes-engine) re-resolve their tarball URLs on every call site and every podspec evaluation during a single pod install. Each resolution re-issues the same requests to the Maven repositories, so identical requests are made many times per install. This PR adds a shared cache in `ReactNativePodsUtils` for RNCore/RNDeps and a self-contained one in `hermes-utils.rb`. ## Changelog: [IOS] [CHANGED] - Cache Maven repository requests (artifact existence probes, nightly metadata) during pod install to avoid re-issuing identical requests on every podspec evaluation Test Plan: I've added logs locally and inspected number of cache hits and misses from the single `pod install` in rn-tester: ``` RCT_USE_PREBUILT_RNCORE=1 RCT_TESTONLY_RNCORE_VERSION=0.81.0 RCT_USE_RN_DEP=1 RCT_DEPS_VERSION=0.81.0 bundle exec pod install 2>&1 | tee /tmp/pod.log ``` ``` [Cache] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz [Cache] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-release.tar.gz [Cache] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-core-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-core-debug.tar.gz [Cache] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-core-release.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-core-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-debug.tar.gz [Cache] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/react/react-native-artifacts/0.81.0/react-native-artifacts-0.81.0-reactnative-dependencies-release.tar.gz [Hermes] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/hermes/hermes-ios/260318099.0.1/hermes-ios-260318099.0.1-hermes-ios-debug.tar.gz [Hermes] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/hermes/hermes-ios/260318099.0.1/hermes-ios-260318099.0.1-hermes-ios-debug.tar.gz [Hermes] [bench] HIT probe (request saved): https://repo.reactnative.dev/maven2/com/facebook/hermes/hermes-ios/260318099.0.1/hermes-ios-260318099.0.1-hermes-ios-debug.tar.gz [Hermes] [bench] MISS probe (requesting): https://repo.reactnative.dev/maven2/com/facebook/hermes/hermes-ios/260318099.0.1/hermes-ios-260318099.0.1-hermes-ios-release.tar.gz ``` Differential Revision: D114341998 Pulled By: coado
coado
force-pushed
the
ruby-requests-optimization
branch
from
July 31, 2026 11:03
bd2ee06 to
7f97ec1
Compare
|
@coado has exported this pull request. If you are a Meta employee, you can view the originating Diff in D114341998. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The Ruby scripts that resolve prebuilt artifacts (ReactNativeCore, ReactNativeDependencies, hermes-engine) re-resolve their tarball URLs on every call site and every podspec evaluation during a single pod install. Each resolution re-issues the same requests to the Maven repositories, so identical requests are made many times per install.
This PR adds a shared cache in
ReactNativePodsUtilsfor RNCore/RNDeps and a self-contained one inhermes-utils.rb.Changelog:
[IOS] [CHANGED] - Cache Maven repository requests (artifact existence probes, nightly metadata) during pod install to avoid re-issuing identical requests on every podspec evaluation
Test Plan:
I've added logs locally and inspected number of cache hits and misses from the single
pod installin rn-tester:Differential Revision: D114341998
Pulled By: coado