You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ky...@apache.org on 2018/11/29 07:33:38 UTC

[incubator-weex] branch master updated: *[Android] weex performance optimization (#1844)

This is an automated email from the ASF dual-hosted git repository.

kyork pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e1aacb  *[Android] weex performance optimization (#1844)
4e1aacb is described below

commit 4e1aacb2274c10033787afd375fd4aad7f1f1cb3
Author: chen <lu...@users.noreply.github.com>
AuthorDate: Thu Nov 29 15:33:34 2018 +0800

    *[Android] weex performance optimization (#1844)
    
    * try get debug flag from env params
    * rm useless log rm
    * try get debugflag from environment
    * get cpu abi from Build.CPU_ABI;
---
 .../com/alibaba/weex/commons/adapter/BlurTool.java |  1 -
 .../weex/commons/adapter/JSExceptionAdapter.java   |  3 +-
 .../extend/module/location/DefaultLocation.java    |  5 +-
 .../main/java/com/taobao/weex/WXEnvironment.java   | 21 ++++--
 .../src/main/java/com/taobao/weex/WXSDKEngine.java |  1 +
 .../main/java/com/taobao/weex/WXSDKInstance.java   | 81 +++++++++++-----------
 .../taobao/weex/adapter/IWXUserTrackAdapter.java   |  1 +
 .../com/taobao/weex/bridge/WXBridgeManager.java    | 55 +++++++++++----
 .../java/com/taobao/weex/ui/component/WXText.java  |  4 +-
 .../list/template/WXRecyclerTemplateList.java      |  4 +-
 .../com/taobao/weex/ui/module/WXModalUIModule.java |  1 -
 .../java/com/taobao/weex/utils/TypefaceUtil.java   |  5 +-
 .../com/taobao/weex/utils/WXSoInstallMgrSdk.java   | 11 ++-
 .../main/java/com/taobao/weex/utils/WXUtils.java   |  2 +-
 14 files changed, 118 insertions(+), 77 deletions(-)

diff --git a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
index e968032..53eb456 100644
--- a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
+++ b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/BlurTool.java
@@ -85,7 +85,6 @@ public class BlurTool {
                 }
 
                 Bitmap result = stackBlur(sampledImage,radius);
-                WXLogUtils.d(TAG, "elapsed time on blurring image(radius:"+ radius + ",sampling: " + sampling + "): " + (System.currentTimeMillis() - start) + "ms");
                 return result;
             }catch (Exception e) {
                 WXLogUtils.e(TAG, "thrown exception when blurred image(times = " + i + "),"+ e.getMessage());
diff --git a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
index bf0c5e3..3c6c2ff 100644
--- a/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
+++ b/android/commons/src/main/java/com/alibaba/weex/commons/adapter/JSExceptionAdapter.java
@@ -18,6 +18,7 @@
  */
 package com.alibaba.weex.commons.adapter;
 
+import com.taobao.weex.WXEnvironment;
 import com.taobao.weex.adapter.IWXJSExceptionAdapter;
 import com.taobao.weex.common.WXJSExceptionInfo;
 import com.taobao.weex.utils.WXLogUtils;
@@ -29,7 +30,7 @@ public class JSExceptionAdapter implements IWXJSExceptionAdapter {
 
   @Override
   public void onJSException(WXJSExceptionInfo exception) {
-    if (exception != null) {
+    if (exception != null && WXEnvironment.isApkDebugable()) {
       WXLogUtils.d(exception.toString());
     }
   }
diff --git a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
index a2df53d..5b24def 100644
--- a/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
+++ b/android/playground/app/src/main/java/com/alibaba/weex/extend/module/location/DefaultLocation.java
@@ -33,6 +33,7 @@ import android.os.Message;
 import android.support.v4.app.ActivityCompat;
 import android.text.TextUtils;
 
+import com.taobao.weex.WXEnvironment;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.bridge.SimpleJSCallback;
 import com.taobao.weex.utils.WXLogUtils;
@@ -128,7 +129,9 @@ public class DefaultLocation implements ILocatable {
 
   @Override
   public void watchPosition(final String successCallback, final String errorCallback, final String params) {
-    WXLogUtils.d("into--[watchPosition] successCallback:" + successCallback + " errorCallback:" + errorCallback + "\nparams:" + params);
+    if (WXEnvironment.isApkDebugable()){
+      WXLogUtils.d("into--[watchPosition] successCallback:" + successCallback + " errorCallback:" + errorCallback + "\nparams:" + params);
+    }
     if (!TextUtils.isEmpty(params)) {
       try {
         JSONObject jsObj = new JSONObject(params);
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
index 1bdb8d1..b46f020 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXEnvironment.java
@@ -100,6 +100,8 @@ public class WXEnvironment {
   /** from init to sdk-ready **/
   public static long sSDKInitTime =0;
 
+  public static long sJSFMStartListenerTime=0;
+
   /**
    * component and modules ready
    * */
@@ -110,6 +112,7 @@ public class WXEnvironment {
   public static LogLevel sLogLevel = LogLevel.DEBUG;
   private static boolean isApkDebug = true;
   public static boolean isPerf = false;
+  private static boolean sDebugFlagInit = false;
 
   private static boolean openDebugLog = false;
 
@@ -277,20 +280,26 @@ public class WXEnvironment {
       return false;
     }
 
-    if (!isApkDebug) {
-      return false;
+    if (sDebugFlagInit){
+      return isApkDebug;
     }
     try {
-      ApplicationInfo info = sApplication.getApplicationInfo();
-      isApkDebug = (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
-      return isApkDebug;
+      String debugModeConfig = getCustomOptions().get(WXConfig.debugMode);
+      if (TextUtils.isEmpty(debugModeConfig)){
+        ApplicationInfo info = sApplication.getApplicationInfo();
+        isApkDebug = (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
+      }else {
+        isApkDebug = Boolean.valueOf(debugModeConfig);
+      }
     } catch (Exception e) {
       /**
        * Don't call WXLogUtils.e here,will cause stackoverflow
        */
       e.printStackTrace();
+      isApkDebug = false;
     }
-    return true;
+    sDebugFlagInit = true;
+    return isApkDebug;
   }
 
   public static boolean isPerf() {
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
index beb6a50..f528654 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKEngine.java
@@ -25,6 +25,7 @@ import android.content.res.Resources;
 import android.support.v4.content.LocalBroadcastManager;
 import android.text.TextUtils;
 
+import android.util.Log;
 import com.taobao.weex.adapter.IDrawableLoader;
 import com.taobao.weex.adapter.IWXHttpAdapter;
 import com.taobao.weex.adapter.IWXImgLoaderAdapter;
diff --git a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
index 32c3dd9..f51af1a 100644
--- a/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
+++ b/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java
@@ -613,7 +613,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     mWXPerformance.beforeInstanceRender(mInstanceId);
 
     if(WXEnvironment.isApkDebugable() && WXPerformance.DEFAULT.equals(pageName)){
-      WXLogUtils.e("WXSDKInstance", "Please set your pageName or your js bundle url !!!!!!!");
 
       if (getUIContext() != null) {
         new AlertDialog.Builder(getUIContext())
@@ -682,8 +681,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
       mBundleUrl = mWXPerformance.pageName;
     }
 
-    WXLogUtils.d("WXSDKInstance", "Start render page: " + pageName);
-
     if (WXTracing.isAvailable()) {
       WXTracing.TraceEvent traceEvent = WXTracing.newEvent("executeBundleJS", mInstanceId, -1);
       traceEvent.traceId = mExecJSTraceId;
@@ -950,9 +947,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
   }
 
   public Context getContext() {
-    if(mContext == null){
-      WXLogUtils.e("WXSdkInstance mContext == null");
-    }
     return mContext;
   }
 
@@ -1058,7 +1052,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityCreate();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityCreate can not be call!");
+        if (WXEnvironment.isApkDebugable()){
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityCreate can not be call!");
+        }
     }
 
     mGlobalEventReceiver=new WXGlobalEventReceiver(this);
@@ -1080,7 +1076,10 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityStart();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+
+        }
     }
 
   }
@@ -1091,7 +1090,10 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onCreateOptionsMenu(menu);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityStart can not be call!");
+
+        }
     }
     return true;
   }
@@ -1116,10 +1118,11 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityPause();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely,onActivityPause can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely,onActivityPause can not be call!");
+        }
     }
 
-    WXLogUtils.i("Application onActivityPause()");
     if (!mCurrentGround) {
       WXLogUtils.i("Application to be in the backround");
       Intent intent = new Intent(WXGlobalEventReceiver.EVENT_ACTION);
@@ -1147,7 +1150,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityResume();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityResume can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityResume can not be call!");
+        }
     }
 
     if (mCurrentGround) {
@@ -1176,10 +1181,11 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityStop();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityStop can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityStop can not be call!");
+        }
     }
 
-
   }
 
   @Override
@@ -1189,7 +1195,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityDestroy();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityDestroy can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityDestroy can not be call!");
+        }
     }
 
     destroy();
@@ -1203,7 +1211,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       return mRootComp.onActivityBack();
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityBack can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityBack can not be call!");
+        }
     }
 
     return false;
@@ -1236,7 +1246,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
       mRootComp.onActivityResult(requestCode,resultCode,data);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onActivityResult can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w("Warning :Component tree has not build completely, onActivityResult can not be call!");
+        }
     }
   }
 
@@ -1248,7 +1260,10 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mRootComp != null) {
        mRootComp.onRequestPermissionsResult(requestCode,permissions,grantResults);
     }else{
-      WXLogUtils.w("Warning :Component tree has not build completely, onRequestPermissionsResult can not be call!");
+        if (WXEnvironment.isApkDebugable()) {
+            WXLogUtils.w(
+                "Warning :Component tree has not build completely, onRequestPermissionsResult can not be call!");
+        }
     }
   }
 
@@ -1303,7 +1318,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
    * call back when update finish
    */
   public void onUpdateFinish() {
-    WXLogUtils.d("Instance onUpdateSuccess");
+    if (WXEnvironment.isApkDebugable()){
+      WXLogUtils.d("Instance onUpdateSuccess");
+    }
   }
 
 
@@ -1319,11 +1336,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
 
     long time = System.currentTimeMillis() - mRenderStartTime;
     long[] renderFinishTime = WXBridgeManager.getInstance().getRenderFinishTime(getInstanceId());
-    WXLogUtils.renderPerformanceLog("onRenderSuccess", time);
-    WXLogUtils.renderPerformanceLog("   invokeCreateInstance",mWXPerformance.communicateTime);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessCallBridgeTime", renderFinishTime[0]);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessCssLayoutTime", renderFinishTime[1]);
-    WXLogUtils.renderPerformanceLog("   onRenderSuccessParseJsonTime", renderFinishTime[2]);
 
     mWXPerformance.callBridgeTime = renderFinishTime[0];
     mWXPerformance.cssLayoutTime = renderFinishTime[1];
@@ -1333,7 +1345,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     if(mWXPerformance.screenRenderTime<0.001){
       mWXPerformance.screenRenderTime =  time;
     }
-    WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, "mComponentNum:" + mWXPerformance.componentCount);
 
     if (mRenderListener != null && mContext != null) {
       mRenderListener.onRenderSuccess(WXSDKInstance.this, width, height);
@@ -1343,8 +1354,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
         performance.args=getBundleUrl();
         mUserTrackAdapter.commit(mContext,null,IWXUserTrackAdapter.JS_BRIDGE,performance,getUserTrackParams());
       }
-
-      WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, mWXPerformance.toString());
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d(WXLogUtils.WEEX_PERF_TAG, mWXPerformance.toString());
+      }
     }
     if(WXEnvironment.isPerf()){
       WXLogUtils.e("weex_perf",mWXPerformance.getPerfData());
@@ -1352,7 +1364,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
   }
 
   public void onRefreshSuccess(final int width, final int height) {
-    WXLogUtils.renderPerformanceLog("onRefreshSuccess", (System.currentTimeMillis() - mRefreshStartTime));
     if (mRenderListener != null && mContext != null) {
       mRenderListener.onRefreshSuccess(WXSDKInstance.this, width, height);
     }
@@ -1391,10 +1402,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
     }
 
     if (!isOutOfScreen) {
-
-//      WXLogUtils.renderPerformanceLog("   interactionViewAddCount", getWXPerformance().interactionViewAddCount);
-//      WXLogUtils.renderPerformanceLog("   interactionViewAddLimitCount", getWXPerformance().interactionViewAddLimitCount);
-//      WXLogUtils.renderPerformanceLog("   interactionTime", getWXPerformance().interactionTime);
       mApmForInstance.arriveInteraction(component);
     }
   }
@@ -1500,13 +1507,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
       mApmForInstance.arriveFSRenderTime();
       mWXPerformance.fsRenderTime = System.currentTimeMillis();
       mWXPerformance.screenRenderTime = System.currentTimeMillis() - mRenderStartTime;
-
-      long[] fitstScreenPerformance = WXBridgeManager.getInstance().getFirstScreenRenderTime(getInstanceId());
-      WXLogUtils.renderPerformanceLog("firstScreenRenderFinished", mWXPerformance.screenRenderTime);
-      WXLogUtils.renderPerformanceLog("    firstScreenJSFExecuteTime", mWXPerformance.firstScreenJSFExecuteTime);
-      WXLogUtils.renderPerformanceLog("    firstScreenCallBridgeTime", fitstScreenPerformance[0]);
-      WXLogUtils.renderPerformanceLog("    firstScreenCssLayoutTime", fitstScreenPerformance[1]);
-      WXLogUtils.renderPerformanceLog("    firstScreenParseJsonTime", fitstScreenPerformance[2]);
   }
 
   private void destroyView(View rootView) {
@@ -2011,11 +2011,9 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
         mApmForInstance.updateRecordInfo(response.extendParams);
         Object actualNetworkTime=response.extendParams.get("actualNetworkTime");
         mWXPerformance.actualNetworkTime=actualNetworkTime instanceof Long?(long)actualNetworkTime:0;
-        WXLogUtils.renderPerformanceLog("actualNetworkTime", mWXPerformance.actualNetworkTime);
 
         Object pureNetworkTime=response.extendParams.get("pureNetworkTime");
         mWXPerformance.pureNetworkTime=pureNetworkTime instanceof Long?(long)pureNetworkTime:0;
-        WXLogUtils.renderPerformanceLog("pureNetworkTime", mWXPerformance.pureNetworkTime);
 
         Object connectionType=response.extendParams.get("connectionType");
         mWXPerformance.connectionType=connectionType instanceof String?(String)connectionType:"";
@@ -2065,7 +2063,6 @@ public class WXSDKInstance implements IWXActivityStateListener,View.OnLayoutChan
           }
         }
       }
-      WXLogUtils.renderPerformanceLog("networkTime", mWXPerformance.networkTime);
       String wxErrorCode = WXInstanceApm.VALUE_ERROR_CODE_DEFAULT;
       if (response!=null && response.originalData!=null && TextUtils.equals("200", response.statusCode)) {
         mApmForInstance.onStage(WXInstanceApm.KEY_PAGE_STAGES_DOWN_BUNDLE_END);
diff --git a/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java b/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
index ec6be03..915399e 100644
--- a/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
+++ b/android/sdk/src/main/java/com/taobao/weex/adapter/IWXUserTrackAdapter.java
@@ -43,6 +43,7 @@ public interface IWXUserTrackAdapter {
   String STREAM_MODULE = "streamModule";
   String INVOKE_MODULE = "invokeModule";
   String INIT_FRAMEWORK = "initFramework";
+  String COUNTER = "counter";
 
   /**
    * monitor keys
diff --git a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
index 00bb1b8..20f2b0d 100644
--- a/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
+++ b/android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java
@@ -66,6 +66,7 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.InputStreamReader;
+import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.text.DateFormat;
@@ -335,7 +336,6 @@ public class WXBridgeManager implements Callback, BactchExecutor {
         WXServiceManager.execAllCacheJsService();
       } else {
         WXLogUtils.e("WXBridgeManager", "WXEnvironment.sApplication is null, skip init Inspector");
-        WXLogUtils.w("WXBridgeManager", new Throwable("WXEnvironment.sApplication is null when init Inspector"));
       }
     }
     if (remoteDebug && mWxDebugProxy != null) {
@@ -1169,7 +1169,6 @@ public class WXBridgeManager implements Callback, BactchExecutor {
                 + ", data:" + data);
           }
           mWXBridge.fireEventOnDataRenderNode(instanceId, ref,type,JSON.toJSONString(data));
-          WXLogUtils.renderPerformanceLog("fireEventOnDataRenderNode", System.currentTimeMillis() - start);
         } catch (Throwable e) {
           String err = "[WXBridgeManager] fireEventOnDataRenderNode " + WXLogUtils.getStackTrace(e);
           WXExceptionUtils.commitCriticalExceptionRT(instanceId,
@@ -1283,7 +1282,6 @@ public class WXBridgeManager implements Callback, BactchExecutor {
               refreshData.data == null ? "{}" : refreshData.data);
       WXJSObject[] args = {instanceIdObj, dataObj};
       mWXBridge.refreshInstance(instanceId, null, METHOD_REFRESH_INSTANCE, args);
-      WXLogUtils.renderPerformanceLog("invokeRefreshInstance", System.currentTimeMillis() - start);
     } catch (Throwable e) {
       String err = "[WXBridgeManager] invokeRefreshInstance " + WXLogUtils.getStackTrace(e);
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
@@ -1844,7 +1842,19 @@ public class WXBridgeManager implements Callback, BactchExecutor {
       }
       try {
         if (WXSDKManager.getInstance().getWXStatisticsListener() != null) {
+          long start = System.currentTimeMillis();
           WXSDKManager.getInstance().getWXStatisticsListener().onJsFrameworkStart();
+          WXEnvironment.sJSFMStartListenerTime = System.currentTimeMillis() - start;
+          try {
+            IWXUserTrackAdapter adapter = WXSDKManager.getInstance().getIWXUserTrackAdapter();
+            if (null != adapter){
+              Map<String,Serializable> params = new HashMap<>(1);
+              params.put("time",String.valueOf(WXEnvironment.sJSFMStartListenerTime));
+              adapter.commit(WXEnvironment.getApplication(),"sJSFMStartListener",IWXUserTrackAdapter.COUNTER,null,params);
+            }
+          }catch (Exception e){
+            e.printStackTrace();
+          }
         }
 
         long start = System.currentTimeMillis();
@@ -1867,9 +1877,7 @@ public class WXBridgeManager implements Callback, BactchExecutor {
         // extends initFramework
         if (mWXBridge.initFrameworkEnv(framework, assembleDefaultOptions(), crashFile, pieSupport) == INIT_FRAMEWORK_OK) {
           WXEnvironment.sJSLibInitTime = System.currentTimeMillis() - start;
-          WXLogUtils.renderPerformanceLog("initFramework", WXEnvironment.sJSLibInitTime);
           WXEnvironment.sSDKInitTime = System.currentTimeMillis() - WXEnvironment.sSDKInitStart;
-          WXLogUtils.renderPerformanceLog("SDKInitTime", WXEnvironment.sSDKInitTime);
           setJSFrameworkInit(true);
 
           if (WXSDKManager.getInstance().getWXStatisticsListener() != null) {
@@ -1905,8 +1913,6 @@ public class WXBridgeManager implements Callback, BactchExecutor {
       @Override
       public void run() {
         WXEnvironment.sComponentsAndModulesReadyTime = System.currentTimeMillis() - WXEnvironment.sSDKInitStart;
-        WXLogUtils.renderPerformanceLog("ComponentModulesReadyTime", WXEnvironment.sComponentsAndModulesReadyTime);
-        WXLogUtils.d("ComponentModulesReadyTime " + WXEnvironment.sComponentsAndModulesReadyTime);
       }
     });
   }
@@ -2445,7 +2451,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
                             HashMap<String, String> styles, HashMap<String, String> attributes, HashSet<String> events,
                             float[] margins, float[] paddings, float[] borders,boolean willLayout) {
     if (TextUtils.isEmpty(pageId) || TextUtils.isEmpty(componentType) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callAddElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callAddElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(pageId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callAddElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2491,7 +2499,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callRemoveElement(String instanceId, String ref) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callRemoveElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callRemoveElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callRemoveElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2534,7 +2544,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callMoveElement(String instanceId, String ref, String parentref, int index) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(parentref)) {
-      WXLogUtils.d("[WXBridgeManager] call callMoveElement arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callMoveElement arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callMoveElement",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2573,7 +2585,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callAddEvent(String instanceId, String ref, String event) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(event)) {
-      WXLogUtils.d("[WXBridgeManager] call callAddEvent arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callAddEvent arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callAddEvent",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2612,7 +2626,9 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callRemoveEvent(String instanceId, String ref, String event) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref) || TextUtils.isEmpty(event)) {
-      WXLogUtils.d("[WXBridgeManager] call callRemoveEvent arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callRemoveEvent arguments is null");
+      }
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callRemoveEvent",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2654,7 +2670,10 @@ public class WXBridgeManager implements Callback, BactchExecutor {
                              HashMap<String, String> borders) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callUpdateStyle arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callUpdateStyle arguments is null");
+      }
+
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callUpdateStyle",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2694,7 +2713,10 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callUpdateAttrs(String instanceId, String ref, HashMap<String, String> attrs) {
 
     if (TextUtils.isEmpty(instanceId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callUpdateAttrs arguments is null");
+      if (WXEnvironment.isApkDebugable()){
+        WXLogUtils.d("[WXBridgeManager] call callUpdateAttrs arguments is null");
+      }
+
       WXExceptionUtils.commitCriticalExceptionRT(instanceId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callUpdateAttrs",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
@@ -2731,7 +2753,10 @@ public class WXBridgeManager implements Callback, BactchExecutor {
   public int callLayout(String pageId, String ref, int top, int bottom, int left, int right, int height, int width, int index) {
 
     if (TextUtils.isEmpty(pageId) || TextUtils.isEmpty(ref)) {
-      WXLogUtils.d("[WXBridgeManager] call callLayout arguments is null");
+        if (WXEnvironment.isApkDebugable()){
+            WXLogUtils.d("[WXBridgeManager] call callLayout arguments is null");
+        }
+
       WXExceptionUtils.commitCriticalExceptionRT(pageId,
               WXErrorCode.WX_RENDER_ERR_BRIDGE_ARG_NULL, "callLayout",
               "arguments is empty, INSTANCE_RENDERING_ERROR will be set", null);
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
index e68cb37..93905d4 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXText.java
@@ -208,14 +208,12 @@ public class WXText extends WXComponent<WXTextView> implements FlatComponent<Tex
           Layout layout = hostView.getTextLayout();
           if (layout != null) {
             layout.getPaint().setTypeface(fontDO.getTypeface());
-            WXLogUtils.d("WXText", "Apply font family " + fontFamily + " to paint");
           } else {
-            WXLogUtils.w("WXText", "Layout not created");
+            WXLogUtils.d("WXText", "Layout not created");
           }
           WXBridgeManager
               .getInstance().markDirty(getInstanceId(), getRef(), true);
         }
-        WXLogUtils.d("WXText", "Font family " + fontFamily + " is available");
       }
     };
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
index 93bdc2b..6b7e233 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/template/WXRecyclerTemplateList.java
@@ -1613,7 +1613,9 @@ public class WXRecyclerTemplateList extends WXVContainer<BounceRecyclerView> imp
                 }
             }
         } catch (Exception e) {
-            WXLogUtils.d(TAG + " onLoadMore : ", e);
+            if (WXEnvironment.isApkDebugable()){
+                WXLogUtils.d(TAG + " onLoadMore : ", e);
+            }
         }
     }
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
index 3449359..fc1367f 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/module/WXModalUIModule.java
@@ -260,7 +260,6 @@ public class WXModalUIModule extends WXSDKEngine.DestroyableModule {
   @Override
   public void destroy() {
     if (activeDialog != null && activeDialog.isShowing()) {
-      WXLogUtils.w("Dismiss the active dialog");
       activeDialog.dismiss();
     }
   }
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java b/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
index 2d113bc..507b527 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/TypefaceUtil.java
@@ -58,7 +58,9 @@ public class TypefaceUtil {
       for (Map.Entry<String, Typeface> font : fonts.entrySet()) {
         FontDO fontDO = new FontDO(font.getKey(), font.getValue());
         putFontDO(fontDO);
-        WXLogUtils.d("TypefaceUtil", "register new typeface: " + font.getKey());
+        if (WXEnvironment.isApkDebugable()){
+          WXLogUtils.d("TypefaceUtil", "register new typeface: " + font.getKey());
+        }
       }
     }
   }
@@ -68,7 +70,6 @@ public class TypefaceUtil {
   }
 
   public static void removeFontDO(String fontFamilyName) {
-    WXLogUtils.d(TAG, fontFamilyName + " has removed");
     sCacheMap.remove(fontFamilyName);
   }
 
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
index 6bf9b07..21da780 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
@@ -292,9 +292,14 @@ public class WXSoInstallMgrSdk {
   }
 
   private static String _cpuType() {
-
-    String abi = _getFieldReflectively(new Build(), "CPU_ABI");
-    if (abi == null || abi.length() == 0 || abi.equals("Unknown")) {
+    String abi ;
+    try {
+      abi = Build.CPU_ABI;
+    }catch (Exception e){
+      e.printStackTrace();
+      abi = ARMEABI;
+    }
+    if (TextUtils.isEmpty(abi)){
       abi = ARMEABI;
     }
     abi = abi.toLowerCase();
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
index 2a2a52f..839763f 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXUtils.java
@@ -408,7 +408,7 @@ public class WXUtils {
     try{
       return (WXEnvironment.getApplication().getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
     }catch (Exception e){
-      WXLogUtils.e("[WXUtils] isTabletDevice:", e);
+      //
     }
     return false;
   }