Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

👍 Use Web Streams API instead of Deno.Reader/Deno.Writer to follow recent deno favor #249

Merged
merged 13 commits into from
May 21, 2023

Conversation

lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented May 8, 2023

Use ReadableStream<Uint8Array> and WritableStream<Uint8Array> internally. It does not change APIs of denops itself so it should be a non breaking change.

This change will reduce one-shot RPC performance, but appears to improve performance when accessed in batches.

Benchmark with Deno v1.33.3

Vim

Before
info
  size:   64 bytes
  count:  1000
  n:      100
denops.call()
  sum:     12592 ms
  mean:    125.9 ms
  median:  119.5 ms
  stddev:  30.2
  stderr:  3.0 ms
  opms:    8.1±0.1 ops/ms
  cpms:    520.5±5.8 chars/ms
denops.batch()
  sum:     613 ms
  mean:    6.1 ms
  median:  5.4 ms
  stddev:  4.6
  stderr:  0.5 ms
  opms:    180.0±2.4 ops/ms
  cpms:    11517.3±154.2 chars/ms
After
info
  size:   64 bytes
  count:  1000
  n:      100
denops.call()
  sum:     14291 ms
  mean:    142.9 ms
  median:  138.8 ms
  stddev:  24.5
  stderr:  2.4 ms
  opms:    7.1±0.1 ops/ms
  cpms:    453.9±3.8 chars/ms
denops.batch()
  sum:     465 ms
  mean:    4.6 ms
  median:  4.5 ms
  stddev:  0.6
  stderr:  0.1 ms
  opms:    217.3±1.8 ops/ms
  cpms:    13905.9±112.0 chars/ms

Neovim

Before
info
  size:   64 bytes
  count:  1000
  n:      100
denops.call()
  sum:     12047 ms
  mean:    120.5 ms
  median:  112.7 ms
  stddev:  35.0
  stderr:  3.5 ms
  opms:    8.6±0.1 ops/ms
  cpms:    547.2±6.4 chars/ms
denops.batch()
  sum:     297 ms
  mean:    3.0 ms
  median:  2.8 ms
  stddev:  0.6
  stderr:  0.1 ms
  opms:    343.6±3.9 ops/ms
  cpms:    21991.7±250.8 chars/ms
After
info
  size:   64 bytes
  count:  1000
  n:      100
denops.call()
  sum:     13586 ms
  mean:    135.9 ms
  median:  131.5 ms
  stddev:  24.5
  stderr:  2.4 ms
  opms:    7.5±0.1 ops/ms
  cpms:    477.9±4.1 chars/ms
denops.batch()
  sum:     210 ms
  mean:    2.1 ms
  median:  2.0 ms
  stddev:  0.6
  stderr:  0.1 ms
  opms:    488.7±5.4 ops/ms
  cpms:    31277.2±343.1 chars/ms

@lambdalisue lambdalisue marked this pull request as draft May 8, 2023 14:38
@lambdalisue lambdalisue changed the title Use Web Streams API instead of Deno.Reader/Deno.Writer to follow recent deno favor 💥 Use Web Streams API instead of Deno.Reader/Deno.Writer to follow recent deno favor May 8, 2023
@lambdalisue lambdalisue changed the base branch from main to remove-trace May 8, 2023 15:31
Base automatically changed from remove-trace to main May 8, 2023 15:36
@lambdalisue lambdalisue force-pushed the stream branch 3 times, most recently from 2a3ed1e to 535a300 Compare May 11, 2023 14:35
@codecov
Copy link

codecov bot commented May 14, 2023

Codecov Report

❗ No coverage uploaded for pull request base (v5@6b29032). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@          Coverage Diff          @@
##             v5     #249   +/-   ##
=====================================
  Coverage      ?   92.68%           
=====================================
  Files         ?        3           
  Lines         ?       82           
  Branches      ?        6           
=====================================
  Hits          ?       76           
  Misses        ?        6           
  Partials      ?        0           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lambdalisue lambdalisue changed the title 💥 Use Web Streams API instead of Deno.Reader/Deno.Writer to follow recent deno favor 👍 Use Web Streams API instead of Deno.Reader/Deno.Writer to follow recent deno favor May 14, 2023
@lambdalisue lambdalisue requested review from Milly and Shougo May 15, 2023 17:00
@lambdalisue lambdalisue marked this pull request as ready for review May 15, 2023 17:00
@lambdalisue lambdalisue changed the base branch from main to v5 May 15, 2023 17:05
denops/@denops-private/host/vim.ts Outdated Show resolved Hide resolved
autoload/denops/api/vim.vim Show resolved Hide resolved
Co-authored-by: Milly <milly.ca@gmail.com>
@lambdalisue lambdalisue requested a review from Milly May 16, 2023 13:44
@lambdalisue
Copy link
Member Author

We'll release v5 in this weekend.

@lambdalisue lambdalisue merged commit 346a27c into v5 May 21, 2023
@lambdalisue lambdalisue deleted the stream branch May 21, 2023 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants