When working on T291194, I noticed that ChangeMentor sometimes takes over a second per mentor.
2021-09-16 18:36:17 [dc3e712e-4631-41b0-b7e1-af159d7e4c5d] mw1392 arwiki 1.37.0-wmf.21 api INFO: API POST Martin_Urbanec_(WMF) [redacted] T=172ms action=growthsetmentor [redacted] 2021-09-16 18:36:27 [e0325fa8-ee09-481b-a3fa-8cf5d54001c2] mw1443 arwiki 1.37.0-wmf.21 api INFO: API POST Martin_Urbanec_(WMF) [redacted] T=1100ms action=growthsetmentor [redacted] 2021-09-16 18:36:29 [74966b8c-ce1e-4f34-b2a4-868830efe134] mw1410 arwiki 1.37.0-wmf.21 api INFO: API POST Martin_Urbanec_(WMF) [redacted] T=1136ms action=growthsetmentor [redacted]
https://performance.wikimedia.org/xhgui/run/view?id=614386f2f09ba49ec8ee85e8 says MultiHttpClient::runMultiCurl takes most time in those requests. By live testing on production, I confirmed sending an Echo notification from as a deferred update speeds the API a lot for the client (while taking similar time once requests finishes).
Since notifying the mentee does not need to happen during the request, I decided to put it in a deferred update.