Skip to content

Commit 6fa76f7

Browse files
committed
update readme
1 parent 0b325f6 commit 6fa76f7

File tree

2 files changed

+7
-135
lines changed

2 files changed

+7
-135
lines changed

README-zh_cn.md

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencyResolutionManagement {
4141

4242
```groovy
4343
plugins {
44-
id 'com.dreamgyf.android.fastinflate' version '0.1.0-alpha-06' apply false
44+
id 'com.dreamgyf.android.fastinflate' version '0.1.0-alpha-07' apply false
4545
}
4646
```
4747

@@ -57,7 +57,7 @@ plugins {
5757

5858
```groovy
5959
dependencies {
60-
implementation 'com.dreamgyf.android.fastinflate:0.1.0-alpha-06'
60+
implementation 'com.dreamgyf.android.fastinflate:0.1.0-alpha-07'
6161
}
6262
```
6363

@@ -80,72 +80,7 @@ FastInflate.from(this).inflate(R.layout.activity_main, null)
8080

8181
## 性能测试
8282

83-
**注:以下测试结果均基于此分支`activity_main`布局**
84-
85-
### *Pixel 6 pro, Android SDK 33*
86-
87-
- 同一布局首次`inflate`耗时(单位:ms 毫秒)
88-
89-
| FastInflate | LayoutInflater |
90-
|-------------|----------------|
91-
| 23ms | 28ms |
92-
| 23ms | 29ms |
93-
| 22ms | 29ms |
94-
| 24ms | 30ms |
95-
| 21ms | 29ms |
96-
| 23ms | 29ms |
97-
| 23ms | 29ms |
98-
| 23ms | 29ms |
99-
| 22ms | 28ms |
100-
| 23ms | 30ms |
101-
102-
`FastInflate`平均耗时`22.7ms`
103-
104-
`LayoutInflater`平均耗时`29ms`
105-
106-
性能提升约`27.75%`
107-
108-
- 同一布局第二次`inflate`耗时(单位:µs 微秒)
109-
110-
| FastInflate | LayoutInflater |
111-
|-------------|----------------|
112-
| 1895µs | 2810µs |
113-
| 2009µs | 3223µs |
114-
| 1898µs | 2659µs |
115-
| 1904µs | 2990µs |
116-
| 1891µs | 2767µs |
117-
| 1861µs | 2802µs |
118-
| 2051µs | 3004µs |
119-
| 1886µs | 3001µs |
120-
| 1957µs | 2930µs |
121-
| 1888µs | 2940µs |
122-
123-
`FastInflate`平均耗时`1924µs`
124-
125-
`LayoutInflater`平均耗时`2912.6µs`
126-
127-
性能提升约`51.38%`
128-
129-
- 同一布局`inflate`1000次耗时(单位:ms 毫秒)
130-
131-
| FastInflate | LayoutInflater |
132-
|-------------|----------------|
133-
| 835ms | 1318ms |
134-
| 848ms | 1330ms |
135-
| 844ms | 1343ms |
136-
| 845ms | 1338ms |
137-
| 848ms | 1344ms |
138-
| 853ms | 1343ms |
139-
| 856ms | 1354ms |
140-
| 855ms | 1363ms |
141-
| 846ms | 1369ms |
142-
| 843ms | 1344ms |
143-
144-
`FastInflate`平均耗时`847.3ms`
145-
146-
`LayoutInflater`平均耗时`1344.6ms`
147-
148-
性能提升约`58.69%`
83+
修复`context`问题后,性能降至和`LayoutInflater`相当的水平,后续想办法再提高性能
14984

15085
## 仓库
15186

README.md

Lines changed: 4 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencyResolutionManagement {
4141

4242
```groovy
4343
plugins {
44-
id 'com.dreamgyf.android.fastinflate' version '0.1.0-alpha-06' apply false
44+
id 'com.dreamgyf.android.fastinflate' version '0.1.0-alpha-07' apply false
4545
}
4646
```
4747

@@ -57,7 +57,7 @@ plugins {
5757

5858
```groovy
5959
dependencies {
60-
implementation 'com.dreamgyf.android.fastinflate:0.1.0-alpha-06'
60+
implementation 'com.dreamgyf.android.fastinflate:0.1.0-alpha-07'
6161
}
6262
```
6363

@@ -80,72 +80,9 @@ FastInflate.from(this).inflate(R.layout.activity_main, null)
8080

8181
## Performance test
8282

83-
**ps:The following test results are based on `activity_main` layout of this branch.**
83+
After fixing the context problem, the performance drops to the same level as that of the LayoutInflater.
8484

85-
### *Pixel 6 pro, Android SDK 33*
86-
87-
- Time consumption of first `inflate` layout(Unit: ms)
88-
89-
| FastInflate | LayoutInflater |
90-
|-------------|----------------|
91-
| 23ms | 28ms |
92-
| 23ms | 29ms |
93-
| 22ms | 29ms |
94-
| 24ms | 30ms |
95-
| 21ms | 29ms |
96-
| 23ms | 29ms |
97-
| 23ms | 29ms |
98-
| 23ms | 29ms |
99-
| 22ms | 28ms |
100-
| 23ms | 30ms |
101-
102-
`FastInflate` takes `22.7ms` on average
103-
104-
`LayoutInflater` takes `29ms` on average
105-
106-
Performance improved by about `27.75%`
107-
108-
- Time consumption of second `inflate` layout(Unit: µs)
109-
110-
| FastInflate | LayoutInflater |
111-
|-------------|----------------|
112-
| 1895µs | 2810µs |
113-
| 2009µs | 3223µs |
114-
| 1898µs | 2659µs |
115-
| 1904µs | 2990µs |
116-
| 1891µs | 2767µs |
117-
| 1861µs | 2802µs |
118-
| 2051µs | 3004µs |
119-
| 1886µs | 3001µs |
120-
| 1957µs | 2930µs |
121-
| 1888µs | 2940µs |
122-
123-
`FastInflate` takes `1924µs` on average
124-
125-
`LayoutInflater` takes `2912.6µs` on average
126-
127-
Performance improved by about `51.38%`
128-
129-
- Time consumption of `inflate` 1000 times for the same layout(Unit:ms)
130-
131-
| FastInflate | LayoutInflater |
132-
|-------------|----------------|
133-
| 835ms | 1318ms |
134-
| 848ms | 1330ms |
135-
| 844ms | 1343ms |
136-
| 845ms | 1338ms |
137-
| 848ms | 1344ms |
138-
| 853ms | 1343ms |
139-
| 856ms | 1354ms |
140-
| 855ms | 1363ms |
141-
| 846ms | 1369ms |
142-
| 843ms | 1344ms |
143-
144-
`FastInflate` takes `847.3ms` on average
145-
146-
`LayoutInflater` takes `1344.6ms` on average
147-
148-
Performance improved by about `58.69%`
85+
I'll find ways to improve performance in the future.
14986

15087
## Repositories
15188

0 commit comments

Comments
 (0)