dapetcu21 / atom-autocomplete-lua

Extensible autocomplete+ provider for Lua
35 stars 6 forks source link

Delay requires to an idle callback #18

Closed pablomayobre closed 7 years ago

pablomayobre commented 7 years ago

To reduce activation time for this package (which is over 1 second in an Intel i5 8GB of RAM notebook) I would like to propose (and offer a pull request), to delay all the requires which can be found at the top of index.js to an idle callback like what can be seen here

This waits until there is nothing to do (ie Atom is idle), to require all the needed files. This will need some refactoring since most of required files are exported immediately... but it should work if they checked for existence before of actually returning.

As I said I can offer a PR with the proposed enhancement.