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

refactor: optimize scoped storage bootstrap speed #1997

Merged
merged 2 commits into from
Nov 24, 2022

Conversation

erha19
Copy link
Member

@erha19 erha19 commented Nov 22, 2022

Types

  • 🪚 Refactors
  • 🚀 Performance Improvements

Background or solution

优化 ScopedStorage 冷启动速度,不再依赖 workspaceService.whenReady 逻辑,框架内启动速度提升约 50%

Before:
image
After:
image

同时修改 Terminal 恢复逻辑,采用 ScopedBrowserStorageService 进行浏览器存储管理。

局部浏览器缓存路径从 scoped:file:///...:/recent 修改为 scoped:/....:/recent 移除了多余的 file://,该修改会导致用户首次加载新版本时进入冷启动逻辑(字段改动导致之前的缓存失效),影响不大。

Changelog

optimize scoped storage bootstrap speed

@erha19 erha19 requested a review from life2015 November 22, 2022 03:46
@github-actions github-actions bot added the ⚙️ refactor Refactor code label Nov 22, 2022
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 57.44% // Head: 57.44% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (739d801) compared to base (90c434f).
Patch coverage: 13.33% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1997   +/-   ##
=======================================
  Coverage   57.44%   57.44%           
=======================================
  Files        1289     1289           
  Lines       80695    80700    +5     
  Branches    16880    16880           
=======================================
+ Hits        46352    46356    +4     
- Misses      31221    31223    +2     
+ Partials     3122     3121    -1     
Flag Coverage Δ
jsdom 52.20% <13.33%> (+<0.01%) ⬆️
node 15.86% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...ages/terminal-next/src/browser/terminal.restore.ts 0.00% <0.00%> (ø)
...kages/core-browser/src/services/storage-service.ts 75.30% <50.00%> (-1.62%) ⬇️
packages/core-common/src/node/port.ts 44.77% <0.00%> (-2.99%) ⬇️
packages/storage/src/browser/storage.ts 63.38% <0.00%> (+1.40%) ⬆️
packages/utils/src/buffer.ts 34.88% <0.00%> (+1.74%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@erha19 erha19 force-pushed the refactor/optimize-scoped-storage-bootstrap-speed branch from bb320a8 to 8dc3b9a Compare November 23, 2022 07:30
@erha19 erha19 force-pushed the refactor/optimize-scoped-storage-bootstrap-speed branch from 8dc3b9a to 739d801 Compare November 23, 2022 08:29
@Aaaaash
Copy link
Member

Aaaaash commented Nov 23, 2022

/publish

@github-actions
Copy link
Contributor

🎉 PR Next version 2.21.6-next-1669195469.0 publish successful! You can install prerelease version via npm install package@2.21.6-next-1669195469.0 @Aaaaash

2.21.6-next-1669195469.0

/home/runner/work/_temp/_runner_file_commands/step_summary_d438ce7e-ac79-4f3e-825b-6d75ef2a2933

Copy link
Member

@Aaaaash Aaaaash 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 2f7f49d into main Nov 24, 2022
@erha19 erha19 deleted the refactor/optimize-scoped-storage-bootstrap-speed branch November 24, 2022 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ refactor Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants