Slow activation time


#1

Hi there! I discovered, that my pug-autocompile package’s activation time is nearly 450ms. It seems that this is not good. What can be done in this situation?


#2

console.time can be used to help identify slow parts.

Also note the reported time from Atom is not always right or useful. There are many other factors that might affect it. I’d trust your own timing tests over the reported Atom time.


#3

Can you look at sources (there is a very simple code) and test? My console.time shows 0.9 ms, but timecop shows another result.


#4

Without knowing how your package is supposed to work: have you considered using activationCommands in your package.json?

Example:

"activationCommands": {
  "atom-workspace": [
    "my-package:some-command"
  ]
}

This will activate the package when my-package:some-command is invoked.


#5

No, I have some subscriptions in the activate() method