Hidden cost of GetFileInformationByHandle
blog.axiorema.com·1d·
Discuss: Hacker News
📦Deflate
Preview
Report Post

The documentation describes the GetFileInformationByHandle Windows API function as a “more basic version” of its advanced variant. While it offers simplicity and ease of use, that convenience comes at a cost.

It is difficult to find a practical scenario where a single I/O call becomes the actual bottleneck of an entire operation. But for narrative purposes, it could be any of the following:

  1. An application that iterates over thousands of files in various locations, querying their timestamps
  2. A service that frequently reads a small number of “hot” files and queries their sizes in advance to preallocate buffers
  3. A developer so obsessed with the I/O efficiency of a function that the…

Similar Posts

Loading similar posts...