Improve perfrormance of WP7 multiple IsolatedStorageFile.ExistDirectory calls

In my new project, I need to check the isolated storage to get if the Directory is exist, but if the directories have the same parent directory, we can first call isf.GetDirectoryNames(Path.Combine(“Downloads”, “*”)); to get the directories and then using strings.contain(xxx), after all, performance is fine.

With a lot of isf.DirectoryExists:
About cost 1.1s
With GetDirectoryNames and strings.contain(xxx)
After change the code, cost 0.11s.

Leave a Reply

Your email address will not be published / Required fields are marked *