nathanhi / pyfatfs

Python based FAT12/FAT16/FAT32 implementation with VFAT support
https://pypi.org/project/pyfatfs/
MIT License
29 stars 14 forks source link

Optimize sequential I/O with big files + small bug fixes in writing/allocating clusters #7

Closed koolkdev closed 3 years ago

koolkdev commented 3 years ago

When writing a big file in small chunks, the write is getting slower and slower because of few locations that iterate on all the chunks from the beginning every time.

I optimized the seek function in FatIO (when seeking forward), write_data_to_cluster, and write_data_to_cluster (by caching the first free cluster)

Now writing 500MB in 0x4000 chunks takes few seconds instead of few minutes.

nathanhi commented 3 years ago

I planned on reworking/optimizing the seek/write code in the future; amazing work, thank you very much (again) for your contribution! :slightly_smiling_face: