stronglink icon indicating copy to clipboard operation
stronglink copied to clipboard

Use sendfile(2) where supported

Open btrask opened this issue 9 years ago • 0 comments

Would cut down copying and syscalls compared to the current system. The main bottleneck is HTTPConnectionWriteChunkFile, which is called once per result by the blog interface. For the best case (files under 8K) it looks like this:

  1. switch to thread pool
  2. open
  3. read (returns <8K)
  4. read (returns 0)
  5. close
  6. return from thread pool
  7. writev

I guess sendfile would only eliminate the writev?

Maybe mmap caching is a better approach after all...

btrask avatar Jul 23 '15 22:07 btrask