For the procmon vs. built-in "open file" discrepancy, keep in mind that procmon shows you a lot more information than anything else. For example, I just ran procmon tracing file system activity on calibre.exe startup and did indeed see "CreateFile" operations on epub files. On the surface that looks damning, so let's dig a little deeper. Right-click, Properties. Now we're getting somewhere. On the "Event" tab you can see that the Desired Access is "Read Attributes". So this isn't actually opening the file. This is getting the file attributes, a much lighter file IO access than actually opening (and reading) the file. Just to confirm, click on over to the Stack tab and you can see that calibre is trying to get the length of the file (PyObject_Length), which makes an underlying GetFileAttributesExW call, which never actually calls a CreateFile or OpenFile method. So all is good.
That said, querying attributes on 14,000 files isn't going to be instantaneous. In my case, with the files residing on a network share (server is on a gigabit wired connection but being accessed from a laptop on wifi), the duration of the call was 0.0061760 seconds, or 6 milliseconds.
Honestly, this is the problem with tools like procmon, where too much information can lead to an incorrect diagnosis. Because procmon categorizes querying for file attributes as a "CreateFile" operation, it looks like a ton of CreateFile spew in the output. It's only when you dig in deeper that you realize what's going on.
Edit: Just for further clarification, I verified that the only book file that calibre "opens" from procmon is whatever the first selected book is on startup. So not really a "ton" of calls, but it's still worth pointing out that you have to dig deeper into procmon's output to understand exactly what's happening.
Last edited by toddos; 12-30-2011 at 03:01 AM.
|