Traversing the 230+ git checkouts in my module folder roughly takes 50 seconds and was being run on nearly every admin page load. Therefor i implemented some caching and of course the performance gain is massive. Check it out!
Note: the diff is huge because of indention changes, try git diff --minimal --patience --color-words after applying to filter that some.
Cache validity is hard-coded to 6hours.

CommentFileSizeAuthor
git_deploy-add-caching.patch6.95 KBeMPee584
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

blueyed’s picture

  1. You could use filemtime(".git/") for/with the cache key, so that it invalidates itself automatically - fstat'ing should be rather cheap. This could be an entry in the module's cache entry.
  2. Consider using strpos() instead of preg_grep() when looking for "Fetch URL:" in the output (for performance reasons).
Freso’s picture

Status: Needs review » Postponed (maintainer needs more info)
Darren Oh’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)