stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

test TFLite without flex dep

Open ccen-stripe opened this issue 3 years ago • 1 comments

Summary

Motivation

Testing

  • [ ] Added tests
  • [ ] Modified tests
  • [ ] Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

ccen-stripe avatar Aug 13 '22 01:08 ccen-stripe

Diffuse output:

OLD: identity-example-release-base.apk (signature: none)
NEW: identity-example-release-pr.apk (signature: none)

          │            compressed             │            uncompressed            
          ├───────────┬──────────┬────────────┼───────────┬───────────┬────────────
 APK      │ old       │ new      │ diff       │ old       │ new       │ diff       
──────────┼───────────┼──────────┼────────────┼───────────┼───────────┼────────────
      dex │   6.3 MiB │  6.3 MiB │     -239 B │  17.8 MiB │  17.8 MiB │     -516 B 
     arsc │   1.1 MiB │  1.1 MiB │        0 B │   1.1 MiB │   1.1 MiB │        0 B 
 manifest │   1.9 KiB │  1.9 KiB │        0 B │   6.6 KiB │   6.6 KiB │        0 B 
      res │   385 KiB │  385 KiB │        0 B │ 589.2 KiB │ 589.2 KiB │        0 B 
   native │ 115.9 MiB │  5.7 MiB │ -110.2 MiB │ 377.5 MiB │  14.4 MiB │ -363.1 MiB 
    asset │   9.3 KiB │  9.3 KiB │       -7 B │     9 KiB │     9 KiB │       -7 B 
    other │  28.2 KiB │ 28.2 KiB │        0 B │  27.1 KiB │  27.1 KiB │        0 B 
──────────┼───────────┼──────────┼────────────┼───────────┼───────────┼────────────
    total │ 123.7 MiB │ 13.5 MiB │ -110.2 MiB │   397 MiB │  33.8 MiB │ -363.1 MiB 

         │          raw           │            unique             
         ├────────┬────────┬──────┼────────┬────────┬─────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff        
─────────┼────────┼────────┼──────┼────────┼────────┼─────────────
   files │      2 │      2 │    0 │        │        │             
 strings │ 116688 │ 116682 │   -6 │ 106868 │ 106862 │ -6 (+6 -12) 
   types │  16789 │  16787 │   -2 │  15738 │  15736 │ -2 (+0 -2)  
 classes │  14128 │  14126 │   -2 │  14128 │  14126 │ -2 (+0 -2)  
 methods │ 107754 │ 107747 │   -7 │ 104765 │ 104758 │ -7 (+2 -9)  
  fields │  76629 │  76627 │   -2 │  76385 │  76383 │ -2 (+3 -5)  

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  259 │  259 │  0   
 entries │ 4760 │ 4760 │  0
APK
      compressed      │     uncompressed     │                                                 
─────────┬────────────┼─────────┬────────────┤                                                 
 size    │ diff       │ size    │ diff       │ path                                            
─────────┼────────────┼─────────┼────────────┼─────────────────────────────────────────────────
         │  -30.5 MiB │         │ -107.9 MiB │ - lib/x86_64/libtensorflowlite_flex_jni.so      
         │    -30 MiB │         │ -105.6 MiB │ - lib/x86/libtensorflowlite_flex_jni.so         
         │  -26.3 MiB │         │  -86.5 MiB │ - lib/arm64-v8a/libtensorflowlite_flex_jni.so   
         │  -23.5 MiB │         │  -63.2 MiB │ - lib/armeabi-v7a/libtensorflowlite_flex_jni.so 
 2.3 MiB │     -239 B │ 6.9 MiB │     -516 B │ ∆ classes2.dex                                  
 8.7 KiB │       -7 B │ 8.5 KiB │       -7 B │ ∆ assets/dexopt/baseline.prof                   
─────────┼────────────┼─────────┼────────────┼─────────────────────────────────────────────────
 2.3 MiB │ -110.2 MiB │ 6.9 MiB │ -363.1 MiB │ (total)
DEX
STRINGS:

   old    │ new    │ diff        
  ────────┼────────┼─────────────
   106868 │ 106862 │ -6 (+6 -12) 
  + :
  
  
  
  _
  
  
  
  
  
   
  
  
  
  
  €20B¢R000¢
  R	0X†T¢
  R
  0X†T¢
  R0X†T¢
  R0X†T¢
  R
  0X†T¢
  R0¢
  R0X†T¢
  R00¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0¢
   !R0X†T¢
  R#0¢
  _%¨&
  + LIST_OF_INDICES
  + OUTPUT_SIZE
  + SMAP
  IDDetectorAnalyzer.kt
  Kotlin
  *S Kotlin
  *F
  + 1 IDDetectorAnalyzer.kt
  com/stripe/android/identity/ml/IDDetectorAnalyzer
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,167:1
  1936#2,14:168
  1549#2:182
  1620#2,3:183
  *S KotlinDebug
  *F
  + 1 IDDetectorAnalyzer.kt
  com/stripe/android/identity/ml/IDDetectorAnalyzer
  *L
  83#1:168,14
  104#1:182
  104#1:183,3
  *E
  
  + access_getLIST_OF_INDICES_cp
  + getLIST_OF_INDICES
  
  - 2
  
  
  
  _
  
  
  	
  
  
  
  
  
  €20B¢R000¢
  R	0X†T¢
  R
  0X†T¢
  R0X†T¢
  R0X‚T¢
  R
  0X†T¢
  R0X†T¢
  R0¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0X†T¢
  R0¢
  R0¢
   !R0X†T¢
  ¨#
  - FlexDelegate.java
  - INDEX_NO_ID
  - Lorg/tensorflow/lite/flex/FlexDelegate;
  - Lorg/tensorflow/lite/flex/R;
  - SMAP
  IDDetectorAnalyzer.kt
  Kotlin
  *S Kotlin
  *F
  + 1 IDDetectorAnalyzer.kt
  com/stripe/android/identity/ml/IDDetectorAnalyzer
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  + 3 _Arrays.kt
  kotlin/collections/ArraysKt___ArraysKt
  *L
  1#1,146:1
  1959#2,14:147
  11385#3:161
  11720#3,3:162
  *S KotlinDebug
  *F
  + 1 IDDetectorAnalyzer.kt
  com/stripe/android/identity/ml/IDDetectorAnalyzer
  *L
  73#1:147,14
  96#1:161
  96#1:162,3
  *E
  
  - TFLITE_FLEX_LIB
  - initTensorFlowForTesting
  - nativeCreateDelegate
  - nativeDeleteDelegate
  - nativeInitTensorFlow
  - tensorflowlite_flex_jni
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   15738 │ 15736 │ -2 (+0 -2) 
  - Lorg/tensorflow/lite/flex/FlexDelegate;
  - Lorg/tensorflow/lite/flex/R;
  

METHODS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   104765 │ 104758 │ -7 (+2 -9) 
  + com.stripe.android.identity.ml.IDDetectorAnalyzer_Companion getLIST_OF_INDICES() → List
  + com.stripe.android.identity.ml.IDDetectorAnalyzer access_getLIST_OF_INDICES_cp() → List
  
  - org.tensorflow.lite.flex.FlexDelegate <clinit>()
  - org.tensorflow.lite.flex.FlexDelegate <init>()
  - org.tensorflow.lite.flex.FlexDelegate close()
  - org.tensorflow.lite.flex.FlexDelegate getNativeHandle() → long
  - org.tensorflow.lite.flex.FlexDelegate initTensorFlowForTesting()
  - org.tensorflow.lite.flex.FlexDelegate nativeCreateDelegate() → long
  - org.tensorflow.lite.flex.FlexDelegate nativeDeleteDelegate(long)
  - org.tensorflow.lite.flex.FlexDelegate nativeInitTensorFlow() → long
  - org.tensorflow.lite.flex.R <init>()
  

FIELDS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   76385 │ 76383 │ -2 (+3 -5) 
  + com.stripe.android.identity.ml.IDDetectorAnalyzer_analyze_1 L_2: Object
  + com.stripe.android.identity.ml.IDDetectorAnalyzer LIST_OF_INDICES: List
  + com.stripe.android.identity.ml.IDDetectorAnalyzer OUTPUT_SIZE: int
  
  - com.stripe.android.identity.ml.IDDetectorAnalyzer INDEX_NO_ID: int
  - com.stripe.android.identity.ml.IDDetectorAnalyzer THRESHOLD: float
  - org.tensorflow.lite.flex.FlexDelegate INVALID_DELEGATE_HANDLE: long
  - org.tensorflow.lite.flex.FlexDelegate TFLITE_FLEX_LIB: String
  - org.tensorflow.lite.flex.FlexDelegate delegateHandle: long

github-actions[bot] avatar Aug 13 '22 01:08 github-actions[bot]

Sorry needs to be rebase

ccen-stripe avatar Aug 19 '22 18:08 ccen-stripe

Nice! this should drive down the SDK size a bit

Yes, the compressed size dropped from 123.7 MiB to 13.5 MiB 😱

ccen-stripe avatar Aug 19 '22 18:08 ccen-stripe