Allocating WOULD_BLOCK errors in GPollableOutputStream is costly
Currently GPollableOutputStream->writev_nonblocking
always allocates a GError
for _WOULD_BLOCK
results. This is not much efficient and can be quite expensive in networking scenarios.
A similar issue exists in GPollableInputStream
, and may exist in other non-blocking read/write APIs in GLib.
This issue is to track fixing that. The problem was originally raised with !708 (closed), but that MR never got across the finishing line. Either that MR could be resurrected, or there may be other possible solutions which are less invasive. For example, it might be possible to somehow statically allocate a single WOULD_BLOCK
GError
and always return (and never free) that.
Edited by Philip Withnall