Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with animations running on main thread #5142

Merged
merged 1 commit into from Jun 13, 2022

Conversation

jameswoo-stripe
Copy link
Contributor

@jameswoo-stripe jameswoo-stripe commented Jun 13, 2022

Summary

Fix an issue where animation is running on main thread causing android to skip frames consistently.

Motivation

Performance

https://jira.corp.stripe.com/browse/RUN_MOBILESDK-1075

Testing

  • Added tests
  • Modified tests
  • Manually verified

@github-actions
Copy link
Contributor

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │           compressed           │           uncompressed           
          ├───────────┬───────────┬────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff     
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼──────────
      dex │    14 MiB │    14 MiB │ +566 B │  46.7 MiB │  46.7 MiB │ +1.2 KiB 
     arsc │   1.7 MiB │   1.7 MiB │    0 B │   1.7 MiB │   1.7 MiB │      0 B 
 manifest │   3.5 KiB │   3.5 KiB │    0 B │  16.2 KiB │  16.2 KiB │      0 B 
      res │ 823.3 KiB │ 823.3 KiB │    0 B │   1.3 MiB │   1.3 MiB │      0 B 
   native │   5.4 MiB │   5.4 MiB │    0 B │  13.4 MiB │  13.4 MiB │      0 B 
    asset │     3 MiB │     3 MiB │ -545 B │     3 MiB │     3 MiB │   -545 B 
    other │  79.9 KiB │  79.9 KiB │    0 B │ 154.8 KiB │ 154.8 KiB │      0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼──────────
    total │  24.9 MiB │  24.9 MiB │  +21 B │  66.3 MiB │  66.3 MiB │   +727 B 

         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      4 │      4 │    0 │        │        │            
 strings │ 227231 │ 227234 │   +3 │ 197705 │ 197707 │ +2 (+7 -5) 
   types │  39663 │  39664 │   +1 │  36168 │  36169 │ +1 (+1 -0) 
 classes │  33528 │  33529 │   +1 │  33528 │  33529 │ +1 (+1 -0) 
 methods │ 203772 │ 203777 │   +5 │ 195771 │ 195776 │ +5 (+6 -1) 
  fields │ 152515 │ 152520 │   +5 │ 151490 │ 151495 │ +5 (+7 -2) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  293 │  293 │  0   
 entries │ 5802 │ 5802 │  0
APK
    compressed    │    uncompressed     │                               
─────────┬────────┼──────────┬──────────┤                               
 size    │ diff   │ size     │ diff     │ path                          
─────────┼────────┼──────────┼──────────┼───────────────────────────────
 3.8 MiB │ +566 B │ 11.3 MiB │ +1.2 KiB │ ∆ classes3.dex                
 6.8 KiB │ -545 B │  6.7 KiB │   -545 B │ ∆ assets/dexopt/baseline.prof 
─────────┼────────┼──────────┼──────────┼───────────────────────────────
 3.8 MiB │  +21 B │ 11.3 MiB │   +727 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   197705 │ 197707 │ +2 (+7 -5) 
  + _composableScope
  + Lcom/stripe/android/ui/core/elements/TextFieldUIKt_AnimatedIcons_target_2_1;
  + SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt
  + 2 CompositionLocal.kt
  androidx/compose/runtime/CompositionLocal
  + 3 Composables.kt
  androidx/compose/runtime/ComposablesKt
  + 4 Composer.kt
  androidx/compose/runtime/ComposerKt
  + 5 Effects.kt
  androidx/compose/runtime/EffectsKt
  + 6 Effects.kt
  androidx/compose/runtime/EffectsKt_rememberCoroutineScope_1
  + 7 SnapshotState.kt
  androidx/compose/runtime/SnapshotStateKt__SnapshotStateKt
  *L
  1#1,282:1
  76#2:283
  36#3:284
  25#3:295
  957#4,6:285
  957#4,3:296
  960#4,3:302
  473#5,4:291
  477#5,2:299
  481#5:305
  473#6:301
  76#7:306
  76#7:307
  76#7:308
  76#7:309
  76#7:310
  76#7:311
  76#7:312
  102#7,2:313
  76#7:315
  76#7:316
  76#7:317
  102#7,2:318
  76#7:320
  *S KotlinDebug
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt
  *L
  101#1:283
  158#1:284
  221#1:295
  158#1:285,6
  221#1:296,3
  221#1:302,3
  221#1:291,4
  221#1:299,2
  221#1:305
  221#1:301
  62#1:306
  102#1:307
  103#1:308
  104#1:309
  105#1:310
  106#1:311
  108#1:312
  108#1:313,2
  110#1:315
  113#1:316
  114#1:317
  114#1:318,2
  223#1:320
  *E
  
  + SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_AnimatedIcons_target_2_1
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,282:1
  1849#2,2:283
  *S KotlinDebug
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_AnimatedIcons_target_2_1
  *L
  226#1:283,2
  *E
  
  + SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_TextField_6
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,282:1
  1#2:283
  *E
  
  + SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_TextField_7_1
  + 2 Row.kt
  androidx/compose/foundation/layout/RowKt
  + 3 Layout.kt
  androidx/compose/ui/layout/LayoutKt
  + 4 CompositionLocal.kt
  androidx/compose/runtime/CompositionLocal
  + 5 Composables.kt
  androidx/compose/runtime/ComposablesKt
  + 6 Dp.kt
  androidx/compose/ui/unit/DpKt
  + 7 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,282:1
  73#2,7:283
  80#2:316
  74#2,6:318
  80#2:350
  84#2:357
  84#2:362
  73#3:290
  74#3,11:292
  73#3:324
  74#3,11:326
  87#3:356
  87#3:361
  76#4:291
  76#4:325
  431#5,13:303
  431#5,13:337
  444#5,3:353
  444#5,3:358
  155#6:317
  1849#7,2:351
  *S KotlinDebug
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_TextField_7_1
  *L
  177#1:283,7
  177#1:316
  183#1:318,6
  183#1:350
  183#1:357
  177#1:362
  177#1:290
  177#1:292,11
  183#1:324
  183#1:326,11
  183#1:356
  177#1:361
  177#1:291
  183#1:325
  177#1:303,13
  183#1:337,13
  183#1:353,3
  177#1:358,3
  183#1:317
  184#1:351,2
  *E
  
  + com.stripe.android.ui.core.elements.TextFieldUIKt_AnimatedIcons_target_2_1
  
  - _this_produceState
  - SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt
  + 2 CompositionLocal.kt
  androidx/compose/runtime/CompositionLocal
  + 3 Composables.kt
  androidx/compose/runtime/ComposablesKt
  + 4 Composer.kt
  androidx/compose/runtime/ComposerKt
  + 5 SnapshotState.kt
  androidx/compose/runtime/SnapshotStateKt__SnapshotStateKt
  *L
  1#1,276:1
  76#2:277
  36#3:278
  957#4,6:279
  76#5:285
  76#5:286
  76#5:287
  76#5:288
  76#5:289
  76#5:290
  76#5:291
  102#5,2:292
  76#5:294
  76#5:295
  76#5:296
  102#5,2:297
  76#5:299
  *S KotlinDebug
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt
  *L
  99#1:277
  156#1:278
  156#1:279,6
  60#1:285
  100#1:286
  101#1:287
  102#1:288
  103#1:289
  104#1:290
  106#1:291
  106#1:292,2
  108#1:294
  111#1:295
  112#1:296
  112#1:297,2
  219#1:299
  *E
  
  - SMAP
  TextFieldUI.kt
  Kotlin
  *S Kotlin
  *F
  + 1 TextFieldUI.kt
  com/stripe/android/ui/core/elements/TextFieldUIKt_AnimatedIcons_target_2
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,276:1
  1849#2,2:277
  *S KotlinDebug
  *F
  + 1 TextFieldUI.kt
  
...✂

@jameswoo-stripe jameswoo-stripe merged commit 763719a into master Jun 13, 2022
@jameswoo-stripe jameswoo-stripe deleted the jameswoo/card-brand-filtering-animation-fix branch June 13, 2022 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants