Saturday Night Tuning
I've done some shuffling of the I/O, and have cranked up the speed a bit. From a hundred or so objects per second, with all the put semantics, is up to nearly double that.
To understand what I did, here's a block diagram of the current state of things. Basically, at the file block section, when it committed, instead of just doing one write and blocking everything, it copies the current dirty buffers and drops them into thread pool, with each job waiting on the previous one, and the file_block prior to either clearing, shutting down, or doing a physical read. Obviously there's some optimizations to be had here.
Ultimately, this is fairly straightfoward stuff. I have a web server that gets fed listen jobs by a loop. When a job is queued, it goes into the threadpool. I can put into the threadpool my own jobs by using PostQueuedCompletionStatus, HttpReceiveHttpRequest, ReadFile and WriteFile, each of which wakes up a job as threads are available on the queue. Each job calls the chumpy that gets the next item from the queue, and those items are objects.
So basically, there's an order to it. Below the light blue arrows are to and from MS Windows, and the blue arrows are calls. There's obviously still more performance gains to be had. But for a Saturday night, this isn't too bad of a start.
As it turns out, right now, my biggest bottlenecks are not from i/o dragging me down. But Visual Studio offers a lot of help for checking out this in more detail.