-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify writev and no-writev code paths in lsp_pipe_writer
lsp_pipe_writer has two code paths: * writev: convert the message byte_buffer into a byte_buffer_iovec, and use the writev syscall to write data to the pipe * no-writev: convert the message byte_buffer into a string8, and use the write/WriteFile syscall to write data to the pipe Having two code paths complicates future changes, such as scheduling WriteFile on a separate thread [1]. Settle on one code path as much as possible: * writev: convert the message byte_buffer into a byte_buffer_iovec, and use the writev syscall to write data to the pipe * no-writev: convert the message byte_buffer into a byte_buffer_iovec (same code as if writev is supported), and use the write/WriteFile syscall to write data to the pipe This commit possibly harms performance by calling WriteFile more (with smaller buffers) on Windows. I didn't attempt to measure this performance difference. [1]: #229
- Loading branch information
Showing
2 changed files
with
15 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters