andrewcarreiro / vscode-calculate

Calculation extension for Visual Studio Code
Do What The F*ck You Want To Public License
13 stars 10 forks source link

Slow Startup Activation #4

Closed faustinoaq closed 6 years ago

faustinoaq commented 6 years ago
{
    "activationTimes": {
        "startup": true,
        "codeLoadingTime": 736,
        "activateCallTime": 0,
        "activateResolvedTime": 0,
        "activationEvent": "*"
    }
}

Currently this extension is taking almost 1 second to load, is the slowest extension in my vscode:

screenshot_20180121_132309

I made this issue using the new VSCode profiling feature 👍

andrewcarreiro commented 6 years ago

Thanks for bringing this up. I don't have any immediate ideas around what might be the cause, but I'll take a look in the next few days. Let me know if you have any suggestions.

faustinoaq commented 6 years ago

@andrewcarreiro You can try to reproduce it and share your Running extensions 👍

screenshot_20180124_131443

^ Calculate is still the slowest extension by far, Settings Sync by @shanalikhan is also some slow 😅

shanalikhan commented 6 years ago

😄 Always looking to improve.

https://github.com/shanalikhan/code-settings-sync/issues/472

andrewcarreiro commented 6 years ago

Hm, it looks like the majority of the startup time is being created by loading the full Math.js.

We could consider a different library, but I would be concerned about breaking things for users. If this becomes enough of a pain point, we could consider allowing users to decide through configuration which library they'd want.

For future people, please 👍 up the top comment if startup time becomes something intolerable.

gabrielmoreira commented 6 years ago

Why not use "Performance - Extension Activation" on package.json?

"activationEvents": [
    "onCommand:extension.calculate",
    "onCommand:extension.calculateReplace"
]

My startup activation time:

{
    "activationTimes": {
        "startup": true,
        "codeLoadingTime": 2128,
        "activateCallTime": 0,
        "activateResolvedTime": 0,
        "activationEvent": "*"
    }
}