@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use the changeset parse cache when rendering inline comments in mail

Summary:
Ref T13202. See PHI903 and PHI894. When a bot leaves 100 inline comments on the same file and the revision has a 30-member recipient list, we currently highlight the file 3000 times when building mail.

Instead, engage the parse cache so we highlight it once and reuse the cache 2,999 times.

Test Plan:
- Added debugging code to stop after mail generation and show cache hits/misses.
- Left a bunch of inlines in a file.
- Ran the worker with `bin/worker execute --id ...`.
- Before change: saw 4 comments x 2 recipients = 8 cache misses
- After change: saw 8 cache hits (cache already filled from web UI rendering)
- Removed debugging code, ran worker to completion.
- Used `bin/mail show-outbound --id ... --dump-html` to inspect resulting mail, saw no functional differences.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13202

Differential Revision: https://secure.phabricator.com/D19721

+6
+6
src/applications/differential/mail/DifferentialInlineCommentMailView.php
··· 345 345 $offset_mode = 'old'; 346 346 } 347 347 348 + // See PHI894. Use the parse cache since we can end up with a large 349 + // rendering cost otherwise when users or bots leave hundreds of inline 350 + // comments on diffs with long recipient lists. 351 + $cache_key = $changeset->getID(); 352 + 348 353 $parser = id(new DifferentialChangesetParser()) 354 + ->setRenderCacheKey($cache_key) 349 355 ->setUser($viewer) 350 356 ->setChangeset($changeset) 351 357 ->setOffsetMode($offset_mode)