vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 62 forks source link

Speed up ghubp-host call #394

Open ibizaman opened 5 years ago

ibizaman commented 5 years ago

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"))
vermiculus commented 5 years ago

Shouldn't this rather be done in ghub+?

vermiculus commented 5 years ago

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