On Thu, Jan 24, 2002 at 06:46:36PM +0100, Ole Grossklaus wrote: > Hi All, > > I have recently changed my app to support VFS (if avail). > > Now I have a problem that I'd like to hear some opinions from others: > > I do have to create about 500 files in a user directory using > VFSFileCreate() > The more files I create the longer it takes to create a file. I understand > why. > > It starts wit about 1-2 files per second and ends up with one file per > minute or even less. It takes ages to create 500 files with that - > unacceptable. What am I doing wrong? (or is it just the way it is....?)
Cool, it sounds like they use some kind of linked list for directory structure :-) That would be O(n) per file, which gives O(n^2) for a cycle creating many files. > > I wonder if I can do something to get more performance into this file > creation process, if there is something that has an impact on the speed of > file creation and if somebody else has experienced the same bahaviour. I don't really know, but there could be the possibility that the directory is kept ordered, with the performance penalty coming from preserving the order with a non-randomized algorithm when you create many files with filenames already sorted. You could try to create files without respecting an alphabetical order in case you are doing so now. But I wouldn't be too optimistic. Marco -- ======================================================================== Marco Pantaleoni [EMAIL PROTECTED] Padova, Italy [EMAIL PROTECTED] elastiC language developer http://www.elasticworld.org -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
