obsidian-spaced-repetition icon indicating copy to clipboard operation
obsidian-spaced-repetition copied to clipboard

Startup time

Open TfTHacker opened this issue 3 years ago • 1 comments

Obsidian has a feature you can turn on in community plugin list to measure the startup time of plugins. I see this plugin is the slowest I have. On my iPad 2018 it takes about a second and half to load.

Of course, this isn’t a big deal. But perhaps some startup optimization can be done. Especially since a user may not even use the plugin right away.

The problem is if you get a few plugins that aren’t startup optimized, it slows the start of obsidian.

TfTHacker avatar Feb 12 '22 07:02 TfTHacker

I looked at this briefly, and it seems the stats-modal is accounting for ~17ms of what I profiled as a 28ms load on a MacBook M1. I suspect those numbers are larger on older machines. I'm guessing this is due to having to load the chart.js lib

I could open a PR to dynamically import the chart libs so that Obsidian doesn't have to load them at start https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-4.html

Thoughts @st3v3nmw?

With stats modal

image

Without stats modal

image

olingern avatar Mar 04 '22 13:03 olingern

I could open a PR to dynamically import the chart libs so that Obsidian doesn't have to load them at start https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-4.html

Thoughts @st3v3nmw?

Hi @olingern, that would be a nice fix.

P.S. Sorry for the delayed response

st3v3nmw avatar Oct 12 '22 19:10 st3v3nmw