Apollo Client is 4-10× slower with Hermes vs. JSC
Bug Description
I've noticed a UI freeze when using Apollo Client's local resolvers for sizable amount of data (1000-2000 entities). It turned out that the query resolution runs 4-10 times slower with Hermes enabled.
- [x] I have run
gradle cleanand confirmed this bug does not occur with JSC - [x] The issue is reproducible with the latest version of React Native.
React Native version: 0.75.1 OS: iOS
Steps To Reproduce
Here's a repo that mimics my real-world use case: https://github.com/SimpleCreations/hermes-apollo-client-perf-repro
Please let me know if there's any way I can help narrow down the issue.
Results on simulator
Hermes
Query execution time: 2524.45595908165
Query execution time: 2335.8469998836517
Query execution time: 2370.824375152588
JSC
Query execution time: 330.4612500667572
Query execution time: 245.70958304405212
Query execution time: 240.48808312416077
Results on a real device (iPhone 13 Pro)
Hermes
Query execution time: 2389.434458732605
Query execution time: 2270.058291912079
Query execution time: 2291.424584388733
JSC
Query execution time: 625.5239171981812
Query execution time: 538.3270416259766
Query execution time: 528.1435828208923
Thanks we will look into this. Hermes is usually faster than JSC on iOS devices, so this slowdown must be caused by something specific.
Any update on this
No, and unfortunately no plans to work on it. Unfortunately we are not able to prioritize analyzing existing 3rd party libraries that are not used by Meta for performance.
If someone in the open source community is able to analyze the code and pinpoint exactly what is slow, we might be able to help.