6615 views|2 replies

1w

Posts

25

Resources
The OP
 

[ESP32 Learning] SD card speed comparison test 2 [Copy link]

 
Some time ago, we compared the file reading speed of two SDIO methods. The webmaster asked the author of ESP32_Lobo version Boris about this question. He replied that there is not much difference between the two methods for small files. Therefore, we continued to test the reading and writing of large files. By reading 3 files of different sizes, we can judge the reading speed. First, copy the 3 files to the SD card and rename them to 1, 2, and 3. The file sizes are: 60708, 639659, and 5235712 respectively. 0]) print('file name:', p[0]) print('file size:', filesize(p[0])) for i in range(p[1]): with open(p[0]) as f: while True: x = len(f.read(1024)) total += x if x<1024: break return total def time_it(f, n): t0 = t10 = t20; t1 = t30; t2 = t40; t3 = t50; t4 = t61; t51 = t71; t72 = t82; t83 = t91; t92 = t102; t11 = t120; t13 = t140; t15 = t160; t17 = t180; t192 = t219; t22 = t30 time.ticks_us() total = f(n) t1 = time.ticks_us() dt = time.ticks_diff(t1, t0) print('{} bytes {:5.3f} sec : {:8.3f} Mbytes/sec'.format(total, dt * 1e-6, total/dt)) return total/dt print('==============================================') print(' ESP32 SD 1Line mode speed test:') r0 = time_it(loadf, ('/sd/0', 10)) r1 = time_it(loadf, ('/sd/1', 1)) r2 = time_it(loadf, ('/sd/2', 1))[/code] Test results SD 1Line mode
  1. ============================================================ ESP32 SD 1Line mode speed test: ================================================ file name: /sd/0 file size: 60708 459910 bytes 2.111 sec : 0.218 Mbytes/sec ============================================== file name: /sd/1 file size: 639659 639659 bytes 4.029 sec : 0.159 Mbytes/sec ============================================== file name: /sd/2 file size: 5235712 5167548 bytes 29.547 sec : 0.175 Mbytes/sec >>>
复制代码
SD 4Line mode
  1. ================================================ ESP32 SD 4Line mode speed test: ============================================== file name: /sd/0 file size: 60708 459910 bytes 2.027 sec : 0.227 Mbytes/sec ================================================== file name: /sd/1 file size: 639659 639659 bytes 3.967 sec : 0.161 Mbytes/sec ============================================== file name: /sd/2 file size: 5235712 5167548 bytes 28.836 sec : 0.179 Mbytes/sec >>>
复制代码
As you can see, the difference between the results of 1Line and 4Line modes is still very small. This content is originally created by EEWORLD forum user dcexpert. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

Latest reply

The speed difference is unlikely because the majority of the read and write time is spent on flash operations, not on transfers, resulting in a smaller impact of the transfer speed difference on the overall read and write speed.  Details Published on 2018-9-17 08:41
 
 

6423

Posts

17

Resources
2
 
The speed difference is unlikely because the majority of the read and write time is spent on flash operations, not on transfers, resulting in a smaller impact of the transfer speed difference on the overall read and write speed.

Comments

It is possible, and it is also related to the fact that ESP32 is not optimized enough at present.  Details Published on 2018-9-17 09:10
Personal signaturetraining
 
 
 

1w

Posts

25

Resources
3
 
Bai Ding posted on 2018-9-17 08:41 The speed difference is unlikely because the majority of the read and write time is spent on flash operations, not on transmission, which leads to the impact of transmission speed differences on the overall read and write speed...
It is possible, and it is also related to the fact that ESP32 is not currently optimized enough.
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list