-->
Page 1 of 2

Slow SPIFFS writes

PostPosted: Fri Oct 07, 2016 9:44 am
by RichardS
I format SPIFFs and upload a 900K file to it, then the ESP parses the file and creates more files from it, its like a ZIP file, and parsing is like UNZIP :-)

Issue!

When I upload the exact same file again and re-parse and re-save the same files I go from 10 second execution to 210 seconds.... I am reading and writing 256 bytes all the time, except for the last buffer of a file write which is usually 256 or less.

I .remove() the original file before .open("filename","w");

Why slow?

RichardS

PS. I am also using me-no-dev's async tcp/ip-webserver library which does trigger itself when other things are running, so this could always be a gotcha..... but at the time of the upload and parse its the only thing happening, I can deal with contentions later...

Re: Slow SPIFFS writes

PostPosted: Sat Oct 08, 2016 2:21 pm
by RichardS
No one... anyone..... :-) its driving me nuts.... too slow!

RichardS

Re: Slow SPIFFS writes

PostPosted: Sun Oct 09, 2016 4:53 am
by Vicne
Not sure I understand what you aim to do...
Could you share some code that exhibits the problem ?
Kind regards,
Vicne

Re: Slow SPIFFS writes

PostPosted: Sun Oct 09, 2016 9:51 am
by martinayotte
To my knowledge, SPIFFS slowness should be seen only when FS is too fragmented and almost full, or maybe when existing files are overwritten with new content, or maybe when file count becomes so huge.

How many files do you have ?
Are you writing data block by block or char by char ?

Did you tried some test sketch where files are added sequentially to see if newly added file gradually takes more time to be written ?