-
Our team found that the performance is actually got worse after switching to the new architecture, so I benchmarked and dived into the code for a while, and here's all the information I've investigated so far. My test starts from JSC:
Hermes
We can tell that no matter what engine it is on, the performance with fabric on is worse. And although not for all, the layout procedure takes a big amount of time. This is strange since the new arch use the "flatten view" technology. I check this, and it indeed reduces the complicity of the view tree (9 level in old arch vs 6 level with new arch). What I'm gonna do next is to cut the layout procedure in pieces and hope if I can tell the difference between the old arch and the new one. What's more, I didn't test this on iOS, because I didn't find a function similar to the function P.S. The layout costing time I calculated is to add all the duration of running |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 10 replies
-
Hey 👋 |
Beta Was this translation helpful? Give feedback.
-
I update a new profile to exclude the cost of startup, now the start point of calculation is the
|
Beta Was this translation helpful? Give feedback.
-
+1 to what @troZee mentioned. We need to have the code and the full methodology of how those benchmarks have been executed to start looking into them |
Beta Was this translation helpful? Give feedback.
-
I found that the total cost of measuring( I don't know it this is the root case, but there seem to be too much JNI calls to import keys and values from a native map, I did a calculation and there are 4391 calls of JNI on importing native maps, even though This may explain why fabric on iOS works well, since there's no extra JNI data copy on iOS. P.S. Another test, a view with nearly zero texts vs full of texts:
|
Beta Was this translation helpful? Give feedback.
-
I found this on the doc:
Seems that my guessing is right. |
Beta Was this translation helpful? Give feedback.
-
Hello @psionic12, we spent some time analysing performance and summarised our findings in #123. Could you please try to run your benchmarks on the 0.72.0-RC.1 and see what the performance is like? We've made some improvements. |
Beta Was this translation helpful? Give feedback.
-
@sammy-SC I'll do the benchmark and let you know ASAP. |
Beta Was this translation helpful? Give feedback.
-
Hi @sammy-SC, I found that I can't disable fabric for rn_tester as before. In 0.68, there is a build config for that, but it seems to be deleted in 0.72. Do you know how to do this? Blow is the test result, compared with 0.68 with fabric off:
The result shows that the total layout time cost is even better compared to no fabric, but the time from app start to the view is actually shown is still slow, compared to no fabric, but faster than before, compared to old version with fabric on. |
Beta Was this translation helpful? Give feedback.
-
Anecdotally, I've just moved an app from 0.72 to 0.76 - updates all dependencies. I disabled new architecture and everything runs smoothly again, I found this thread looking for answers because I've read the new architecture is meant to improve performance but I'm just getting glitching everywhere. |
Beta Was this translation helpful? Give feedback.
Hello @psionic12,
we spent some time analysing performance and summarised our findings in #123.
Could you please try to run your benchmarks on the 0.72.0-RC.1 and see what the performance is like? We've made some improvements.