Closed dmig closed 1 year ago
Weird, it takes 14ms for me.
On a blank window I see editorconfig
at 12 ms, however with a project open I'm seeing ~915 ms.
It looks like this time is entirely within the require('editorconfig')
call transparently happening here. It looks like a majority of this time is taken up by undoing many source maps to find an original location.
Since you don't need the TextEditors to be observed immediately on activate, I would recommend moving the observation of the TextEditors into an idle callback. You can find an example of setting this up for a simple function here (make sure you handle early deactivation like this).
You can find a slightly more complex example that is actually observing parts of Atom here.
Note that this is essentially a duplicate of #147.
+1. I see editorconfig take up nearly 92ms to startup.
+1 I'm also in the camp where it's close to 1s on startup.
Thanks for reporting this issue - i'll dig into it as soon as possible.
Also getting more than 1 second consistently -- lmk if there's any way I can help with this! Editorconfig is an essential but with this issue I have to deactivate 😢
Thank you very much for your offer @jescalan. I am sorry wasn't able to fix that yet. Please feel free to help us!
As @Arcanemagus already pointed out this is for sure the implementation of the initial observation of the TextEditor (https://github.com/sindresorhus/atom-editorconfig/blob/master/index.js#L166). As explanation, we're currently embedding a dedicated editorconfig
-object into each TextEditor to manage the Editorconfig-functionality. It is intended to act independent to the rest of the code.
I guess it would be the easiest thing to just detach the execution of the observeTextEditor()
.
However, this must be tested because even though there shouldn't be any cross-dependencies, it could be that something fails to work if the embedded editorconfig-object is not immediately available.
I'd propose the following steps to solve that:
observeTextEditor()
observeTextEditor()
rund synchronousClosing as Atom is abandoned.
Timecop shows, that editorconfig is the slowest package in my installation. Startup times are always higher than 1 second: 1060-1080ms. Doesn't matter, how many files are open at startup time (mostly 2-4). But without project package load time is around 10ms. Looks like, editrconfig makes a lot of unneded file scans.
Involved .editorconfig-files
Directory structure
Installed packages