magithub icon indicating copy to clipboard operation
magithub copied to clipboard

Speed up ghubp-host call

Open ibizaman opened this issue 6 years ago • 2 comments

Magit-status on a repo containing 300 opened PRs took a lot of time. Profiling showed ghubp-host was taking roughly 35%.

This solution uses a hash table to cache the results.

Solves #349 partially.

This PR is not complete, we need a way to refresh the cache

For example, after calling magit-status on this repo, the variable contains:

#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data
("/Users/ibizaman/.emacs.d/straight/repos/magithub/" "api.github.com"))

Then after magit-status on the ghub repo:

#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8125 data
("/Users/ibizaman/.emacs.d/straight/repos/magithub/" "api.github.com" "/Users/ibizaman/.emacs.d/straight/repos/ghub/" "api.github.com"))

ibizaman avatar Nov 26 '18 17:11 ibizaman

Shouldn't this rather be done in ghub+?

vermiculus avatar Dec 02 '18 18:12 vermiculus

Magithub can probably refresh the cache inside macro magithub-cache-without-cache. Most (all?) of the 'full refresh' commands get into this codepath eventually.

vermiculus avatar Dec 02 '18 18:12 vermiculus