Cache the commit author in RequestStore to avoid extra lookups in PostReceive
1 unresolved thread
Compare changes
+ 16
− 1
@@ -178,7 +178,18 @@ class Commit
@@ -306,6 +317,10 @@ class Commit
Do not update/delete: Banner broadcast message test data
Do not update/delete: Notification broadcast message test data
In a PostReceive task with 697 commits (8.9 RC1 -> RC8), looking up the commit author takes about 10% of the time. Caching this information in RequestStore saves a few seconds from the overall processing time.
Improves #18663 (moved)
@stanhu Doesn't
@author = RequestStore.store[key] ||= find_author_by_any_email
work just as well (while being less verbose)?I originally had that, but then changed it because:
find_author_by_any_email
can returnnil
, so I found that if the user were missing we would continue to do lookups@stanhu Ah, gotcha.