I've been playing with some tweaks to masterfs - specifically, I had a
library i wrote for a completely different purpose, which keeps a cache of
open NIO FileChannels.  Partly out of curiosity, and partly because I've
wondered for a while what using NIO more for File IO in NetBeans might
accomplish, I dropped it into masterfs.

Basically, opening a file opens a file channel (the cache key includes the
read/write/truncate options), which is cached, and closed after 60 seconds
if it has not been touched.  Input and output streams just take a lock on
the stream, set its state back to what it was when they last touched it,
and then release the lock.

Subjective impression, after running with these patches for about a week is
that my machine is quieter and the IDE snappier - which makes some sense,
since simply editing a file can trigger a bunch of reads of related file,
so this is dramatically reducing interaction with the OS (in the back of my
mind, I'm wondering if some of the Windows file-stat performance problems
could be bypassed by checking if an open channel exists for some file -
thought you might need to at least try to position the channel to trigger
the IDE noticing if it had been deleted and the channel was invalid).

What would be useful to actually measure if my perception matches reality
would be some performance tests (not startup performance!!) that open a
large number of projects and files, perform edits, switch between things,
and take timings for those operations.  I have the vague sense that such
might exist from one or another round of performance tuning years ago, but
I have no idea where.

Any ideas?

If anyone wants to play with this stuff, it's on the nio-mfs branch of my
fork here:
https://github.com/timboudreau/incubator-netbeans/tree/nio-mfs

(for the time being I just copied the code from three libraries of mine
that live elsewhere;  ideally they would be used as libraries instead, but
it was a quick bit of patching to see if it was even useful to try this)

-Tim

-- 
http://timboudreau.com

Reply via email to