|
@@ -100,10 +100,11 @@ false && describe('upload BASE64 v.s. Storage', (report, done) => {
|
100
|
100
|
})
|
101
|
101
|
|
102
|
102
|
|
103
|
|
-false && describe('write file BASE64 v.s. URI', (report, done) => {
|
|
103
|
+describe('write file BASE64 v.s. URI', (report, done) => {
|
104
|
104
|
let iteration = 200
|
105
|
|
- let target = `${TEST_SERVER_URL}/public/6mb-dummy`
|
|
105
|
+ let target = `${TEST_SERVER_URL}/public/12k-dummy`
|
106
|
106
|
let sourceURI = dirs.DocumentDir + '/benchmark2-source'
|
|
107
|
+ let writeTarget = dirs.DocumentDir +'/benchmark2-target'
|
107
|
108
|
let sourceBASE64 = null
|
108
|
109
|
let b64Res = 0
|
109
|
110
|
let uriRes = 0
|
|
@@ -123,7 +124,8 @@ false && describe('write file BASE64 v.s. URI', (report, done) => {
|
123
|
124
|
<Info key="benchmark progress" uid="report2">
|
124
|
125
|
<Text style={{textAlign:'center'}}>BASE64 {count}/{iteration}</Text>
|
125
|
126
|
</Info>)
|
126
|
|
- return fs.writeFile(dirs.DocumentDir +'/benchmark2-target', sourceBASE64, 'base64')
|
|
127
|
+ return fs.readFile(sourceURI, 'base64')
|
|
128
|
+ .then((data) => fs.writeFile(writeTarget, data))
|
127
|
129
|
}
|
128
|
130
|
else {
|
129
|
131
|
b64Res = Date.now() - begin
|
|
@@ -144,7 +146,7 @@ false && describe('write file BASE64 v.s. URI', (report, done) => {
|
144
|
146
|
<Info key="benchmark progress" uid="report2">
|
145
|
147
|
<Text style={{textAlign:'center'}}>URI {count}/{iteration}</Text>
|
146
|
148
|
</Info>)
|
147
|
|
- return fs.writeFile(dirs.DocumentDir +'/benchmark2-target', sourceURI, 'uri')
|
|
149
|
+ return fs.writeFile(writeTarget, sourceURI, 'uri')
|
148
|
150
|
}
|
149
|
151
|
else {
|
150
|
152
|
uriRes = Date.now() - begin
|
|
@@ -168,7 +170,7 @@ false && describe('write file BASE64 v.s. URI', (report, done) => {
|
168
|
170
|
})
|
169
|
171
|
|
170
|
172
|
|
171
|
|
-describe('read file benchmark', (report, done) => {
|
|
173
|
+false && describe('read file benchmark', (report, done) => {
|
172
|
174
|
|
173
|
175
|
let iteration = 50
|
174
|
176
|
let target = `${TEST_SERVER_URL}/public/1mb-dummy`
|