I have created a folder in the Nand Flash memory. And the folder consists of multiple files. The time taken to create a file in the folder is directly proportional to the total number of files in that folder. Reading or searching for a file in that folder hardly consumes any time.
Also if i create a new folder (and the previous folder still exists) then time taken for creating file increases as total number of files in the folder increase. (i.e. time consumed to create file in empty folder is hardly noticeable but as more files are created, time taken to create files increases).
IMO, This should not happen ideally.
even worse observation. I have few files created in a folder, lets say 100. i delete few files randomly [lets say, the 10th file created (filename: X10), the 20th (XP20), 25th (XYZ25), 35th(X35), 49th(P49), etc.] and then continue to create new files [ab1, Ab3, ab2, ab5]. The newly created file 'ab1' is created in place of 'X10'. 'Ab3' is created in place of 'XP20'. The observation is that the files are created in the place where the last files where deleted (my observation comes from listing the files and the file listing code just reads the files names and sends it on UART). IMO, the files should be created after the last created file. No sorting date wise or in alphabetical order or in the order of creation.
Appreciate your patience & time.
PS: LPC1788. 120MHz core clk. Using Keil File system library.
The observation is that the files are created in the place where the last files where deleted
That doesn't very clearly explain what is happening. I assume you mean that the directory entry is replaced. What about the file data itself?
Replacing a directory entry might be a good choice since it would mean that the directory does not keep growing across multiple sectors unnecessarily.
Replacing the file data itself might be questionable from the point of view of wear levelling.
But whatever happens, this is an implementation detail. If you have really strong feelings on such a detail, speaking to them directly might be a sensible approach. They might well have very good decisions for implementing the code in a particular way.
the directory entry is replaced Ya i meant the same.
But then, replaced directory entry means that i will have to write a sorting algorithm (i have maintained a linked list of file names in RAM, hence the list is maintained in order until power-on). but the problem arises on power-on after power-off.
also any comment on how to reduce the time for creation of new file in a folder already containing many files?
But then, replaced directory entry means that i will have to write a sorting algorithm
You shouldn't really assume any ordering of directory names within the implementation.
Nope. Nothing comes to mind.