epio/mantrid — Issue #2: On linux, use sendfile in actions.Static.handle
Author: alex
Created: 2011-11-02 14:02:20+00:00
State: open

Recent (and old ones too, probably, but definitely recent) versions of the linux kernel provide a `sendfile` API which takes two file descriptors and sends the contents of reading from one to the other. This allows application code to avoid copying (and possibly allocating) strings, as well as avoids context switches and other kernel-y things. Static.handle could use this, optionally, to optimize the sending of a file. See at mantrid/actions.py:L56