Skip to content

Reduce startup time - #41

Merged
mProjectsCode merged 3 commits into
mProjectsCode:masterfrom
Thylane:master
Jan 11, 2025
Merged

mProjectsCode merged 3 commits into
mProjectsCode:masterfrom
Thylane:master

Conversation

@Thylane

@Thylane Thylane commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

Fix #39. The change in startup time is shown in the figure below (recorded by exampleVault):

  • left: load all languages at once → slow startup
  • right: load on demand → starts faster, functions as usual

References:

Note:

  • For on-demand loading, async / await is added to the code that requires highlighter instance this.shiki to load language. Not sure if it will have any impact.
  • In the updateWidgets function, the steps of building decorations are moved outside syntaxTree.iterate.

Comment thread src/Highlighter.ts Outdated
Comment thread src/Highlighter.ts Outdated
Comment thread src/Highlighter.ts Outdated
Comment thread src/codemirror/Cm6_ViewPlugin.ts Outdated
@mProjectsCode mProjectsCode self-assigned this Dec 21, 2024
@acrogenesis

Copy link
Copy Markdown

this is cool

@mProjectsCode mProjectsCode left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM
Sorry, I forgot to rereview this PR.

@mProjectsCode
mProjectsCode merged commit 97a491e into mProjectsCode:master Jan 11, 2025
@mProjectsCode

Copy link
Copy Markdown
Owner

I noticed after merging that eslint and prettier aren't happy. Please run the bun run check command before submitting a PR next time.

@Thylane

Thylane commented Jan 11, 2025

Copy link
Copy Markdown
Contributor Author

I noticed after merging that eslint and prettier aren't happy. Please run the bun run check command before submitting a PR next time.

I ran bun run check and it was complaining about code style in almost all files. (Why?)
I accepted its suggestion to "Run Prettier with --write to fix" and... I don't like the format it imposes. (What now..)

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.

Plugin load time ten times slower than others

3 participants