Commit 2f6c3ed
Decrease amount of requests send to Maven repos (#57765)
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: coado1 parent 63e9c15 commit 2f6c3ed
4 files changed
Lines changed: 74 additions & 15 deletions
File tree
- packages/react-native
- scripts/cocoapods
- sdks/hermes-engine
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
480 | 482 | | |
481 | | - | |
482 | | - | |
483 | | - | |
| 483 | + | |
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
382 | 384 | | |
383 | | - | |
384 | | - | |
385 | | - | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
757 | 758 | | |
758 | 759 | | |
759 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
760 | 802 | | |
761 | 803 | | |
762 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
339 | 347 | | |
340 | 348 | | |
341 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
342 | 355 | | |
343 | 356 | | |
344 | | - | |
345 | | - | |
| 357 | + | |
346 | 358 | | |
347 | | - | |
348 | | - | |
349 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
350 | 367 | | |
351 | 368 | | |
352 | 369 | | |
| |||
0 commit comments