informant icon indicating copy to clipboard operation
informant copied to clipboard

Informant causes pacman to hang for a few seconds

Open poperigby opened this issue 5 years ago • 9 comments

I'm not sure if this is supposed to happen, but when I run a pacman command, when it hits "Checking ArchLinux news", it hangs for a few seconds before moving on.

poperigby avatar Nov 08 '19 18:11 poperigby

Thanks for using informant! What you describe is expected.

This is a side-effect of the included pacman hook. When it runs it needs to make a web request to https://archlinux.org/feeds/news (I don't cache this and it will run every time the hook is called). The time of this web request could be of varying speed depending on your internet connection.

I built the pacman hook as a feature so that I never had to remember to check the news, but if you dislike the time the hook takes to run it is possible to disable the hook. I tried to write a bit about this in the README - basically either placing an overriding hook in /etc/pacman.d/

touch /etc/pacman.d/hooks/informant.hook

or a symlink to /dev/null

ln -s /dev/null /etc/pacman.d/hooks/informant.hook

will disable the hook and you can continue to use informant as a standalone tool.

bradford-smith94 avatar Nov 08 '19 22:11 bradford-smith94

Yeah I knew about the hook. It's unfortunate it causes it to hang. I wonder if their's any way to speed it up.

poperigby avatar Nov 08 '19 22:11 poperigby

I haven't come up with any ideas to make it faster. Some sort of caching could help with multiple calls to informant in a short time period, but it also depends on the response time of the archlinux news feed.

I'm open to ideas for improving it if you or anyone else has them, pull requests are welcome too.

bradford-smith94 avatar Nov 08 '19 22:11 bradford-smith94

I think caching it and periodically updating the cache would be a good idea.

poperigby avatar Nov 08 '19 22:11 poperigby

Hey, you've got to respect data integrity! What would be acceptable imho would be to cache and only full fetch when there is an actual repository update.

Though there are also etags!

ashpieboop avatar Nov 11 '19 05:11 ashpieboop

That's a good idea

poperigby avatar Nov 11 '19 05:11 poperigby

Caching added in AUR version 0.2.0-1.

bradford-smith94 avatar Feb 02 '20 21:02 bradford-smith94

Is there any more improvement that can be made here? At this point it seems the bottlenecks are out of informant's control. Should this issue be closed?

codeclem avatar Jul 28 '20 16:07 codeclem

If the HTTP lookup is taking time, it's not an informant issue.

Strykar avatar Jul 06 '22 20:07 Strykar