leny / atom-w3c-validation

Validate your HTML and CSS files using W3C validators.
MIT License
12 stars 5 forks source link

Start Up Time #18

Open Foggalong opened 8 years ago

Foggalong commented 8 years ago

Just opened Atom and got an unusually long loading time. Looked into it with time cop and 26974ms (~25 seconds) of it were because of this extension. Any idea what's going on?

leny commented 8 years ago

Really no idea, specially since I don't have any problem here.

On which platform did you run atom? Did this append on every load?

I see here on my timecop that the package needs 400ms to load, seems a bit too long for a package that doesn't do much until you launch a validation.

Im' quite busy with pro work for now, I will try to investigate on this during the week.

Foggalong commented 8 years ago

This particular time was with Windows, but but had similar problems before with Linux too. Reloading gave a time of 7540ms but that's still way bigger than any other extension I have

leny commented 8 years ago

Ok, thanks for the heads up. I'll keep you informed.

Foggalong commented 8 years ago

No problem :+1:

walles commented 7 years ago

Timecop reports anything that takes longer than 5ms to activate, so 400ms is still not optimal.

Can't really see what would take time though... https://github.com/leny/atom-w3c-validation/blob/dacb4378a34fd3904dcbe2ea0e420e1ef2433bb8/lib/main.js#L59 ... so I guess fActivate() would have to be instrumented to find out.

walles commented 7 years ago

I'd guess babel is the culprit. But that's just a guess, somebody would have to try this plugin with and without babel and see if that makes any difference.

walles commented 7 years ago

Seems to be a platform issue: https://github.com/atom/atom/issues/13133

walles commented 7 years ago

Suggestion from @thomasjo: https://github.com/atom/atom/issues/13133#issuecomment-258087497 " One thing you can suggest they do, is to defer package activation until necessary by using activationCommands. " It might be activationHooks that would make the most sense here, but same principles apply and they are both documented at the same link.

walles commented 7 years ago

Fixed by #30.