• Brian Geffon's avatar
    Mojo: Prefer using writev(2) when possible on POSIX. · 36d6df46
    Brian Geffon authored
    According to the UMA metrics Mojo.Channel.WriteQueuePendingMessages at
    least 22% of the time there are more than 2 messages queued while
    flushing messages on POSIX systems.
    
    This CL introduces a change where when there is more than one message
    pending it will try to use writev(2). It's important to note that
    we cannot use writev(2) when FileHandles are involved and it handles
    that situation. However, according to Mojo.Channel.WriteMessageHandles
    sending FileHandles is rare and 98.4% of the time messages do not
    contain a FileHandle. So we should be able to benefit from writev(2)
    frequently.
    
    Bug: b:171251106
    Change-Id: Ie632479da835c457d573ba4aa91bb22b8df084b2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2486501
    Commit-Queue: Brian Geffon <bgeffon@chromium.org>
    Reviewed-by: default avatarKen Rockot <rockot@google.com>
    Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#819939}
    36d6df46
content_main_runner_impl.cc 38.5 KB