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 ajv load order #1607

Merged
merged 1 commit into from
Sep 27, 2022
Merged

refactor: optimize ajv load order #1607

merged 1 commit into from
Sep 27, 2022

Conversation

yantze
Copy link
Member

@yantze yantze commented Aug 31, 2022

Types

  • 🪚 Refactors
  • 🚀 Performance Improvements

Background or solution

  • ajv 在初始化和 compile 的时候会花费很长的时间,大概 80~100ms,可以通过延迟加载,在界面出现后,按需进行处理。
    image

  • 优化 menu 在启动逻辑中的引入顺序,避免过早的引入 menu -> keybinding -> monaco-editor 逻辑。这里可以看到引入 tab-bar-toolbar.js 后,会引入 menu 导致后面一连串的加载,导致加载延长,进入源码查看后发现,其实 tab-bar-toolbar 更多的是引入类型,结果把文件都引入后,导致后面的一连串反应。所以要拆分出类型和实现,以便优化启动逻辑
    image

Changelog

优化 ajv 的加载顺序

@erha19 erha19 added this to the 2.21 milestone Aug 31, 2022
@yantze yantze force-pushed the refactor/optimize-ajv branch 3 times, most recently from 7bf00be to 69c2306 Compare September 21, 2022 07:35
@yantze yantze force-pushed the refactor/optimize-ajv branch from 69c2306 to 47ad6e7 Compare September 21, 2022 09:31
@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Base: 57.68% // Head: 57.68% // No change to project coverage 👍

Coverage data is based on head (ecb4569) compared to base (ecb4569).
Patch has no changes to coverable lines.

❗ Current head ecb4569 differs from pull request most recent head 47ad6e7. Consider uploading reports for the commit 47ad6e7 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1607   +/-   ##
=======================================
  Coverage   57.68%   57.68%           
=======================================
  Files        1269     1269           
  Lines       78979    78979           
  Branches    16528    16528           
=======================================
  Hits        45559    45559           
  Misses      30405    30405           
  Partials     3015     3015           
Flag Coverage Δ
jsdom 52.52% <0.00%> (ø)
node 15.79% <0.00%> (ø)

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

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.

yantze added a commit that referenced this pull request Sep 26, 2022
@erha19 erha19 merged commit df680e6 into main Sep 27, 2022
@erha19 erha19 deleted the refactor/optimize-ajv branch September 27, 2022 09:35
yantze added a commit that referenced this pull request Oct 10, 2022
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.

2 participants