Skip to content

feat: optimize stream packet parse performance#3282

Merged
erha19 merged 5 commits intomainfrom
feat/decoder-performance
Jan 19, 2024
Merged

feat: optimize stream packet parse performance#3282
erha19 merged 5 commits intomainfrom
feat/decoder-performance

Conversation

@bytemain
Copy link
Copy Markdown
Member

@bytemain bytemain commented Jan 18, 2024

Types

  • 🎉 New Features

Background or solution

优化流式传输 packet 时的性能:

  1. 减少在解析大 payload 时需要 alloc 的次数
  2. 使用 cursor 维持住当前对 buffer 的查询,每次不需要从头开始查

Changelog

optimize stream packet parse performance

@opensumi opensumi Bot added the 🎨 feature feature required label Jan 18, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 18, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c899849) 57.70% compared to head (7b13a75) 57.77%.

Files Patch % Lines
...on/src/common/connection/drivers/stream-decoder.ts 96.20% 3 Missing ⚠️
...ckages/connection/src/common/connection/buffers.ts 98.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3282      +/-   ##
==========================================
+ Coverage   57.70%   57.77%   +0.06%     
==========================================
  Files        1357     1357              
  Lines       84943    84988      +45     
  Branches    17639    17642       +3     
==========================================
+ Hits        49018    49099      +81     
+ Misses      32654    32618      -36     
  Partials     3271     3271              
Flag Coverage Δ
jsdom 52.65% <96.89%> (+0.06%) ⬆️
node 17.16% <96.89%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@erha19 erha19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@erha19 erha19 merged commit 112a057 into main Jan 19, 2024
@erha19 erha19 deleted the feat/decoder-performance branch January 19, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 feature feature required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants