Commit d2fa1cd
Create basic benchmark for Animated (#52874)
Summary:
Pull Request resolved: #52874
Changelog: [internal]
This creates a basic benchmark for the Animated API, which shows that **using Animated**, even without setting up animations, **makes rendering 3x slower** (similar when setting up a JS driven animation), but **6x slower when it sets up a native animation.**
Baseline:
### Animated (mode 🚀) ###
| (index) | Task name | Latency average (ns) | Latency median (ns) | Throughput average (ops/s) | Throughput median (ops/s) | Samples |
| ------- | ---------------------------------------------------------------------------- | --------------------- | ----------------------- | -------------------------- | ------------------------- | ------- |
| 0 | 'render 1 views' | '85320.76 ± 1.27%' | '82484.00' | '11994 ± 0.09%' | '12124' | 11721 |
| 1 | 'render 10 views' | '399462.22 ± 1.03%' | '387702.00' | '2552 ± 0.29%' | '2579' | 2505 |
| 2 | 'render 100 views' | '3317795.78 ± 0.90%' | '3232351.00 ± 70.00' | '303 ± 0.74%' | '309' | 302 |
| 3 | 'render 1 animated views (without no animations set up)' | '172534.31 ± 0.67%' | '168423.00' | '5874 ± 0.14%' | '5937' | 5796 |
| 4 | 'render 10 animated views (without no animations set up)' | '1050582.87 ± 0.63%' | '1031899.00 ± 20.00' | '957 ± 0.37%' | '969' | 952 |
| 5 | 'render 100 animated views (without no animations set up)' | '9255133.10 ± 1.06%' | '8990333.00' | '108 ± 0.94%' | '111' | 109 |
| 6 | 'render 1 animated views (with a single animation set up - JS driven)' | '203422.03 ± 0.50%' | '198478.00' | '4966 ± 0.17%' | '5038' | 4916 |
| 7 | 'render 10 animated views (with a single animation set up - JS driven)' | '1305600.39 ± 0.37%' | '1288088.00 ± 15.00' | '768 ± 0.30%' | '776' | 766 |
| 8 | 'render 100 animated views (with a single animation set up - JS driven)' | '12084658.14 ± 1.51%' | '11854181.00 ± 8493.00' | '83 ± 1.27%' | '84' | 84 |
| 9 | 'render 1 animated views (with a single animation set up - native driven)' | '313494.69 ± 0.32%' | '308673.00' | '3206 ± 0.19%' | '3240' | 3190 |
| 10 | 'render 10 animated views (with a single animation set up - native driven)' | '2223507.22 ± 0.50%' | '2184839.00 ± 70.00' | '451 ± 0.41%' | '458' | 450 |
| 11 | 'render 100 animated views (with a single animation set up - native driven)' | '21352575.02 ± 0.71%' | '21239136.00 ± 2824.00' | '47 ± 0.69%' | '47' | 64 |
Reviewed By: christophpurrer
Differential Revision: D79085920
fbshipit-source-id: 1dc13208da49cc325995f3455eaf86c4eb1e4d471 parent 797d14d commit d2fa1cd
File tree
1 file changed
+133
-0
lines changed- packages/react-native/Libraries/Animated/__tests__
1 file changed
+133
-0
lines changedLines changed: 133 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
0 commit comments