optimizationsendfilezig

Does Zig's fifo.pump support sendfile?


Zig has fifo.pump() which takes a reader and a writer? Does this support sendfile optimizations on Linux in any case?


Solution

  • It seems like it should to be, but apparently it does not. From truemedian,

    Unfortunately not, pump would need to have a special case for handling the combination of std.fs.File.Reader/std.net.Stream.Reader and std.fs.File.Writer/std.net.Stream.Writer and it simply doesn't.

    Source: https://github.com/orhun/zig-http-benchmarks/issues/16