• Stars
    star
    4,866
  • Rank 8,632 (Top 0.2 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚀Optimizer for mobile applications

Booster

GitHub Build Status GitHub Release

Overview | 概览

Booster is an easy-to-use, lightweight, powerful and extensible quality optimization toolkit designed specially for mobile applications. The primary goal is to solve quality problems with the increase of APP complexity, such as performance, stability, and package size, etc.

Booster provides a collection of modules for performance detection, multithreading optimization, resources index inline, redundant resources reduction, resources compression, system bug fixing, etc. Using booster, the stability of application can be increased by 15% ~ 25%, and the package size can be reduced by 1MB ~ 10MB.

Booster 是一款专门为移动应用设计的易用、轻量级且可扩展的质量优化框架,其目标主要是为了解决随着 APP 复杂度的提升而带来的性能、稳定性、包体积等一系列质量问题。

Booster 提供了性能检测、多线程优化、资源索引内联、资源去冗余、资源压缩、系统 Bug 修复等一系列功能模块,可以使得稳定性能够提升 15% ~ 25%,包体积可以减小 1MB ~ 10MB。

What can Booster be used for? | Booster 能做什么?

  • Performance detection | 性能检测

    Potential performance issues could be found by using Booster, for example, calling APIs that may block the UI thread or main thread, such as I/O APIs. About the details, please see booster-task-analyser.

    使用 Booster 可以发现潜在的性能问题,例如,在应用中调用可能阻塞 UI 线程或者主线程的 API,如:I/O API 等。详情请参见: booster-task-analyser

  • Performance optimization | 性能优化

    Thread management has always been a problem for developers, especially the threads started by third-party SDKs, starting too many threads may cause OOM, fortunately, these issues can be solved by Booster. About the details, please see booster-transform-thread

    对于开发者来说,线程管理一直是个头疼的问题,特别是第三方 SDK 中的线程,过多的线程可能会导致内存不足,然而幸运的是,这些问题都能通过 Booster 来解决。

  • System bugs fix | 系统问题修复

    Such as fixing the crash caused by Toast globally on Android API 25. About the details, please see booster-transform-toast and booster-transform-shared-preferences.

    例如全局性地修复 Android API 25 版本中 Toast 导致的崩溃。详情请参见:booster-transform-toastbooster-transform-shared-preferences.

  • Package size reduction | 应用瘦身

    Such as image resources compression, r inline, etc.

    如:资源压缩及冗余资源删除资源索引内联

  • Other things you can imagine | 其它你能想像得到的

Prerequisite | 先决条件

  • JDK (minimum version required is JDK 1.8, JDK 11 is recommended)
  • Gradle version 4.10+
  • Android Gradle Plugin version 3.3+

The following table lists which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, please use the latest possible version of both Gradle and the plugin.

下表列出了各个 Android Gradle 插件版本所需的 Gradle 版本。要获得最佳性能,请使用 Gradle 和插件这两者的最新版本。

Android Gradle Plugin Gradle
3.3.0 - 3.3.3 4.10.1+
3.4.0 - 3.4.3 5.1.1+
3.5.0 - 3.5.4 5.4.1+
3.6.0 - 3.6.4 5.6.4+
4.0.0+ 6.1.1+
4.1.0+ 6.5+
4.2.0+ 6.7.1+
7.0 7.0+
7.1 7.1+
7.2 7.3.3+
7.3 7.4+
7.4 7.5+

Best Practise | 最佳实践

The best practise of using Booster is integrating the specific module to solve the problems you have encountered as following:

集成 Booster 的最佳方式是集成真正需要的模块来解决项目中遇到的特定问题。

buildscript {
    ext.booster_version = '4.16.2'
    repositories {
        google()
        mavenCentral()

        // OPTIONAL If you want to use SNAPSHOT version, sonatype repository is required.
        maven { url 'https://oss.sonatype.org/content/repositories/public' }
    }
    dependencies {
        classpath "com.didiglobal.booster:booster-gradle-plugin:$booster_version" //
        // ② figure out the features you really need, then choose the right module for integration
        // ② 弄清楚真正需要的特性,然后从下面的模块列表中选择正确的模块进行集成
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

        // OPTIONAL If you want to use SNAPSHOT version, sonatype repository is required.
        maven { url 'https://oss.sonatype.org/content/repositories/public' }
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.didiglobal.booster' //

Then using the following command in terminal to check if Booster enabled

然后在终端用如下命令来确认 Booster 是否启用:

./gradlew assembleDebug --dry-run

If transformClassesWithBoosterForDebug can be found in the output, it means Booster is enabled. Congratulations! 🎉🎉🎉

如果在命令行输出中能搜到 transformClassesWithBoosterForDebug 说明 Booster 已经启用了,那么恭喜你! 🎉🎉🎉

The plugins DSL also supported since Booster 3.0.0

Booster3.0.0 开始支持 plugins DSL 的方式来启用

plugins {
    id 'com.didiglobal.booster' version '4.16.2'
}

Here are all the modules of Booster:

Common

  • booster-aapt2 - AAPT2 相关 API

    implementation "com.didiglobal.booster:booster-aapt2:$booster_version"
  • booster-api - Booster 插件开发 API

    this module contains both booster-transform-spi and booster-task-spi

    implementation "com.didiglobal.booster:booster-api:$booster_version"
  • booster-cha - Class Hierarchy Analysis API

    implementation "com.didiglobal.booster:booster-cha:$booster_version"
  • booster-command - SPI for external command discovery

    implementation "com.didiglobal.booster:booster-command:$booster_version"

Performance

Package Size

  • booster-task-compression-cwebp - 采用 cwebp 对资源进行压缩

    classpath "com.didiglobal.booster:booster-task-compression-cwebp:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false
  • booster-task-compression-pngquant - 采用 pngquant 对资源进行压缩

    classpath "com.didiglobal.booster:booster-task-compression-pngquant:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false

    booster-pngquant-provider could be used for image compressing by pngquant without installation

  • booster-task-compression-processed-res - ap_ 文件压缩

    classpath "com.didiglobal.booster:booster-task-compression-processed-res:$booster_version"
  • booster-task-resource-deredundancy - 去冗余资源

    classpath "com.didiglobal.booster:booster-task-resource-deredundancy:$booster_version"

    The option android.precompileDependenciesResources need to be set on Android Gradle Plugin 3.6 and higher

    android.precompileDependenciesResources=false
  • booster-transform-r-inline - 资源索引内联

    classpath "com.didiglobal.booster:booster-transform-r-inline:$booster_version"
  • booster-transform-br-inline - DataBinding BR索引内联

    classpath "com.didiglobal.booster:booster-transform-br-inline:$booster_version"

System Bug

  • booster-transform-finalizer-watchdog-daemon - 修复 finalizer 导致的 TimeoutException

    classpath "com.didiglobal.booster:booster-transform-finalizer-watchdog-daemon:$booster_version"
  • booster-transform-media-player - 修复 MediaPlayer 崩溃

    classpath "com.didiglobal.booster:booster-transform-media-player:$booster_version"
  • booster-transform-res-check - 检查覆盖安装导致的 ResourcesAssets 未加载的 Bug

    classpath "com.didiglobal.booster:booster-transform-res-check:$booster_version"
  • booster-transform-toast - 修复 Toast 在 Android 7.1 上的 Bug

    classpath "com.didiglobal.booster:booster-transform-toast:$booster_version"
  • booster-transform-activity-thread - 处理系统 Crash

    classpath "com.didiglobal.booster:booster-transform-activity-thread:$booster_version"

Utility

  • booster-task-check-snapshot - 检查 SNAPSHOT 版本

    classpath "com.didiglobal.booster:booster-task-check-snapshot:$booster_version"
  • booster-task-list-permission - 显示 AAR 使用的权限清单

    classpath "com.didiglobal.booster:booster-task-list-permission:$booster_version"
  • booster-task-list-shared-library - 显示 AAR 包含的动态库清单

    classpath "com.didiglobal.booster:booster-task-list-shared-library:$booster_version"

Unit Test

  • booster-test-asm - Support running unit test with ASM based transformer

    classpath "com.didiglobal.booster:booster-task-asm:$booster_version"
  • booster-test-javassist - Support running unit test with Javassist based transformer

    classpath "com.didiglobal.booster:booster-task-javassist:$booster_version"

Samples | 示例

Documentation | 文档

About the details, please see Booster Inside(深入理解 Booster)

API Reference

About the API reference, please see Booster API Reference

Contributing

Welcome to contribute by creating issues or sending pull requests. See Contributing Guideline.

欢迎大家以 issue 或者 pull request 的形式为本项目作贡献。详见 Contributing Guideline

Community

Booster交流群

License

Booster is licensed under the Apache License 2.0.

More Repositories

1

DoKit

一款面向泛前端产品研发全生命周期的效率平台。
Java
20,108
star
2

cube-ui

🔶 A fantastic mobile ui lib implement by Vue
JavaScript
9,141
star
3

chameleon

🦎 一套代码运行多端,一端所见即多端所见
JavaScript
9,016
star
4

VirtualAPK

A powerful and lightweight plugin framework for Android
Java
8,979
star
5

LogicFlow

A flow chart editing framework focusing on business customization. 专注于业务自定义的流程图编辑框架,支持实现脑图、ER图、UML、工作流等各种图编辑场景。
TypeScript
8,315
star
6

KnowStreaming

一站式云原生实时流数据平台,通过0侵入、插件化构建企业级Kafka服务,极大降低操作、存储和管理实时流数据门槛
Java
6,941
star
7

nightingale

An enterprise-level cloud-native monitoring system, which can be used as drop-in replacement of Prometheus for alerting and management.
Go
4,510
star
8

mpx

Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架
JavaScript
3,619
star
9

mand-mobile

💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Vue
3,454
star
10

sharingan

Sharingan(写轮眼)是一个基于golang的流量录制回放工具,适合项目重构、回归测试等。
Go
2,276
star
11

tinyid

ID Generator id生成器 分布式id生成系统,简单易用、高性能、高可用的id生成系统
Java
2,265
star
12

xiaoju-survey

XIAOJUSURVEY is an enterprises form builder and analytics platform that allows users to create questionnaires, exams, polls, quizzes, and analyze data online.
TypeScript
2,065
star
13

ChineseNLP

Datasets, SOTA results of every fields of Chinese NLP
HTML
1,783
star
14

DiDiPrism

小桔棱镜,一款专注移动端操作行为的利器! A powerful tool (iOS & Android) that focuses on mobile operation behavior!
Objective-C
1,716
star
15

gendry

a golang library for sql builder
Go
1,613
star
16

Hummer

一套移动端高性能高可用的动态化跨端开发框架
Objective-C
1,339
star
17

DDMQ

DDMQ is a distributed messaging product with low latency, high throughput and high availability.
Java
1,303
star
18

rdebug

Rdebug — Real Debugger
PHP
1,158
star
19

echo

Echo是一款桌面端调试工具,旨在提高客户端的研发调试效率
Objective-C
1,028
star
20

turbo

Turbo is a light-weight flow engine framework, support BPMN2.0. 一款轻量级流程引擎服务框架,可作为底层服务支持各类流程设计、低代码设计、工作流、审批流、服务编排等场景
Java
895
star
21

DroidAssist

A lightweight Android Studio gradle plugin based on Javassist for editing bytecode in Android.
Java
885
star
22

AoE

AoE (AI on Edge,终端智能,边缘计算) 是一个终端侧AI集成运行时环境 (IRE),帮助开发者提升效率。
C++
874
star
23

DRouter

Android Router Framework
Java
739
star
24

AgileTC

AgileTC is an agile test case management platform
JavaScript
673
star
25

falcon-log-agent

用于监控系统的日志采集agent,可无缝对接open-falcon
Go
583
star
26

super-jacoco

Java
473
star
27

epage

一款基于schema的低代码可视化页面配置工具
Vue
460
star
28

GateKeeper

A high-performance Golang gateway that supports rapid development and plug-inization
Go
436
star
29

sds

SDS是一个基于Java开发的简单、易用、高性能的服务降级系统,支持限流、熔断和降级等功能,服务端必备!!
Java
417
star
30

KnowSearch

面向Elasticsearch研发与运维人员,围绕集群、索引构建的零侵入、多租户的Elasticsearch GUI管控平台
Java
413
star
31

kemon

An Open-Source Pre and Post Callback-Based Framework for macOS Kernel Monitoring.
C
373
star
32

di18n

一种自动转换、基于配置的前端国际化方案
JavaScript
305
star
33

pile.js

pile.js components build with React.
CSS
267
star
34

ES-Fastloader

Quickly build large-scale ElasticSearch indices by using the fault tolerance and parallelism of Hadoop
Java
265
star
35

KnowAgent

基于日志模板构建,采集任务动态管控、数据质量精确度量,一站式日志采集平台
Java
255
star
36

Unify

An efficient, flexible Flutter-Native hybrid communication framework for seamless module integration and automatic code generation.
Dart
255
star
37

LogiCommon

Java版 认证、鉴权、管理、任务调度通用功能组件
Java
218
star
38

Tips

JavaScript
187
star
39

maskdetection

C++
179
star
40

DreamBox

DreamBox是一个为客户端开发者打造的统一视图开发框架,具有性能好、可动态更新的特点
Java
166
star
41

dlflow

DLFlow is a deep learning framework.
Python
157
star
42

didi.github.io

didi website
HTML
143
star
43

hetsann

Source Codes of HetSANN in the AAAI'20 paper: An Attention-based Graph Nerual Network for Heterogeneous Structural Learning.
Python
142
star
44

collection

go collection package for fasting coding
Go
127
star
45

athena

A release version for https://github.com/athena-team/athena
Python
124
star
46

JuShaTa

JuShaTa是一个Java容器,提供模块隔离及模块热加载能力。
Java
121
star
47

logbook

Java
107
star
48

heteta

HetETA: Heterogeneous Information Network Embedding for Estimating Time of Arrival
Python
105
star
49

levin

A Quick Way to Bulk Loading
C++
105
star
50

TrafficIndex

TTI ,Smart Transportation Industry Standard
C++
94
star
51

thrift-mock

A lightweight java test library for mocking thrift server
Java
92
star
52

mand-mobile-rn

💰 Mand Mobile for React Native, designed for financial scenarios.
TypeScript
88
star
53

vue-tmap

一个基于腾讯地图JavaScript API GL、TypeScript 封装适用于 Vue3 的高性能地图组件库
TypeScript
88
star
54

slime-validator

JavaScript library of validation based on Plugin system and make data validation be easy.
JavaScript
85
star
55

mtmc-vt

MTMC Vehicle Tracking For AI City challenge 2019
Jupyter Notebook
70
star
56

FeatureProbe

开源的高效可视化『功能』管理平台,提供灰度发布、AB实验、配置变更全功能。
66
star
57

sgt

didiyun super-agent daemon
Go
58
star
58

ALITA

ALITA is a layer-based data analysis tool. The front-end see
Java
51
star
59

react-tmap

一个基于腾讯地图JavaScript API GL、TypeScript 封装适用于 react 的高性能地图组件库
TypeScript
48
star
60

benchmark-thrift

An open source application designed to load test Thrift applications
Java
45
star
61

elastic-trib

elasticsearch cluster command line tool.
Go
39
star
62

mpx-cube-ui

基于"Mpx 小程序框架"的移动端基础组件库
TypeScript
27
star
63

yarc

基于 eBPF 的流量录制工具
C
26
star
64

tg-flow

Go
24
star
65

paladin

Scala
20
star
66

MEEP

End-to-end framework to build automatic agents (chatbots) for task-oriented dialogs
Python
18
star
67

WorkTrans

Python
15
star
68

ALITA_UI

ALITA is a layer-based data analysis tool. The back-end see
JavaScript
13
star
69

wmt2021_triangular_mt

The baseline model code for WMT 2021 Triangular MT
Python
13
star
70

MeetDot

Python
12
star
71

DAIBench

Shell
10
star
72

didi-tech-edu

9
star
73

daedalus

JavaScript
7
star
74

tmap-types

腾讯地图 js api 类型声明,主要用于 react-tmap 和 vue-tmap 组件库
5
star
75

Json-adapter

Java
3
star