art with code

2008-11-28

Filezoo, 17.1: rewrite done-ish

Got the rewrite just about done and it works pretty well! The UI response times are generally below 100 ms, with some peaks in the 200 ms range. The big problem now is how recursive traversal became very slow and memory hungry. So I guess I get to move the recursive traversal to a more optimized system today. Then write a small session manager and config reader, and make a right-click menu for the files.

Let's see then... a new recursive traversal system that should work like du: have a dictionary of paths, put each directory's traversal results there, and the traversal results should be something like type result = { path : string, done : bool, subdirs : result list, size : long, count : long }. Space usage, maybe something like: 50 bytes path, 4 bytes done, 20 bytes for subdirs, 8 bytes size, 8 bytes count, total 90 bytes? Add in the pointers needed for the dict and it's closer to 110 bytes per directory. The tree I have has around 200 kdirs, so the memory use for the dict would be around 22 megs. Sounds okayish.

The other memory hole is the FSCache getting huge if you browse around enough. If you go through a million files, the memory use will be in the gigabyte range. LRU-pruning large subtrees would help. Stake out some total count limit and start pruning after breaking that.

Probably won't go all that far with the optimization work today, I'd like to do some useful stuff for a change :9

No comments:

Blog Archive