headlamp icon indicating copy to clipboard operation
headlamp copied to clipboard

Make headlamp-plugin faster

Open joaquimrocha opened this issue 1 year ago • 2 comments

headlamp-plugin checks whether there are updates to it every time we run it. While this is nice and useful in a normal use, if we run the command repeatedly, this feature does impact dev experience by taking a long time when we may just be running a simple command, as every check takes usually 1.5-2.0 sec .

So I suggest we only check for updates a limited number of times per day. Maybe once a day is even enough.

If the update is to be skipped, we could print a message telling the user how to force check the updates.

cc/ @illume

joaquimrocha avatar Apr 09 '24 17:04 joaquimrocha

Are you having this issue in just the npm start command?

That should usually be only run once, and then the command just sits there watching for changes - with no update check done. I understand it would be more of a problem when the npm start was buggy and it had to be run on each change.

It could be made async, so it doesn't block the user getting work done. I think it uses npm internally, which could be switched to a direct https call.

illume avatar Apr 10 '24 07:04 illume

During the "watch" bug it was certainly annoying. But also in live demos it usually just seems like it takes too long. I think it's worth making faster or only running sporadically, but certainly not urgent.

joaquimrocha avatar Apr 11 '24 20:04 joaquimrocha

@skoeva I want to emphasize this part of my comment:

It could be made async, so it doesn't block the user getting work done.

If the check is done async, then it can show the message some moments later. This avoids having state, and has the benefit that it isn't slow once a day. The user is never slowed down in their work.

illume avatar May 08 '24 07:05 illume