art with code


Filezoo: start of day 4

Moved to using Pango for text rendering, now my UTF-8 filenames render correctly. But it's slow. So the theme of the day is performance. From directory opening latency (creating a WaitCallback for a dir and adding it to the ThreadPool sometimes causes a 20ms pause, so when you have lots of dirs, you get to wait a second or more), to crappy overview drawing performance (/usr/lib has only 3380 files in it, and it's already a pain to navigate), to crappy panning performance (need to skip clipped entries altogether.)

For the ThreadPool pauses, I should make a filesystem traversal server that has a hashtable, a request queue and a worker thread. When a dir needs its total size and count, it asks the traversal server, which returns the current result immediately, and puts the dir to the queue if it's not already completely traversed. The worker thread then takes a random entry from the queue and adds the file sizes of the entry to the corresponding dir in the hashtable along with the dir's ancestors. If the dir has no subdirs, the worker thread marks it as completed and walks up its ancestors, marking each completed if all its subdirs are completed. If the dir taken from the queue has subdirs, the worker thread adds the subdirs to the queue.

Ok, sounds like enough work for the day.

Tried to make a Gtk user interface using the GUI designer but failed, and the GUI designer was a huge bother of point-and-click-UI. And since I want a certain visual look, it's well nigh impossible with the normal widgets. Oh, if making GUIs worked like HTML or SVG...
Post a Comment

Blog Archive

About Me

My photo

Built art installations, web sites, graphics libraries, web browsers, mobile apps, desktop apps, media player themes, many nutty prototypes