The C++ utilities I wrote for Armory are almost that fast (but in linux only, have no idea why windows is so damned slow!). I buffer blk000X.dat into RAM 50 MB at a time, and then pass around pointers to this data and scan it directly -- to avoid any extra copies. It's a lot of pointers...
Looks like you went and re-did by hand pretty much what
the OS does for free when you use memory-mapped files ...
I used memory-mapped files in version 0.60 to 0.77 of Armory. Not only was it slow as dirt in Windows (though it worked brilliantly in Linux), it won't work on any 32-bit systems once the blockchain reaches 4GB+. 32-bit processes can't allocate enough virtual memory. Hell, Win32 wouldn't take it at all even with 4 GB RAM, and a 1 GB blockchain (hence why Armory never worked in Win32). Not only that, but mmap is OS-dependent. If you want to use Map-Of-File-Views (the mmap equiv in Windows) you're going to deal with windows.h and LPWCSTRs.
I'm so glad I got rid of that. That's why I emulate it now, and it cleaned up my code a bit not having to branch base on OS.
I understand about the python wrappers. You don't have to use the python, there's a pure C++ library underneath, though it's not obvious how to use it. BlockUtilsTest.cpp has a lot of examples, but it's not intended for educational purposes: it's really for me to do my unit-testing.
And in the end, I always approve of people digging in and implementing pieces of Bitcoin. There's no better way to
really undrestand it.
