Reputation: 7074
What are the maximum number of files that can be stored in a directory for Windows Phone 7?
Upvotes: 3
Views: 901
Reputation: 14882
Around 10,000 is about right as a theoretical maximum subject to testing different file sizes (details in the first article).
However, beyond 128 the performance degrades substantially as outlined in the charts in my original article (ty for linking Boryana :).
App Angles | wp7dev blog by Mick N » How many files are too many files for isolated storage?
128 is the most performant maximum number of files in a folder as a result.
Performance degradation was demonstrated to impact CreateFile(), OpenFile() and GetAllFiles() in 7004. NoDo introduces a new performance consideration which extends performance degradation to other APIs which I've covered on twitter and will detail in the final NoDo update article.
I've developed a light weight, declarative abstraction to provide a logical folder that hides the detail of using multiple folders to accomplish good performance. This uses the exact same interface as IsolatedStorageFile, so is a simple search and replace to put into use. You can configure the underlying physical folder structure to suit your app with as little as a single statement.
I'm currently putting NoDo on a production device through it's paces and have posted a preliminary update in the next article.
The abstraction has been revised for NoDo as the new performance consideration is effectively a breaking change for this library.
Updates have been posted on Twitter as I was identifying the source of the breaking changes and putting the modified abstraction through testing @MickNDev.
I'll have the final article for NoDo published shortly to demonstrate once again a theoretically unlimited number of files can be stored in the abstracted logical folder without noteable performance degradation.
Testing so far shows 863,766 files can be stored before a low disk space warning interrupts the run.
As mentioned in my second article, I'm happy to publish the abstraction if anyone would like to put it into production use. I'll do this eventually regardless when I get back to the app I needed it for (currently priority bumped) as it will benefit from community development.
I'm hoping to be able to test this early on Mango to a) provide performance feedback on Isolated Storage use to the dev team and b) have the abstraction ready for any production use before Mango is pushed out to devices. If you also feel this would be beneficial to the platform feel free to help get it on Brandon Watson's radar. He's on twitter @BrandonWatson or his email is google searchable.
Upvotes: 5
Reputation: 2730
Check this post: How many files are too many files for isolated storage?
Upvotes: 5