Batch the profile page's viewer-relationship lookups (#3648) (#3649)

  • Batch the profile page's viewer-relationship lookups (#3648)

The profile page was slow in two independent ways, both CPU/memcache-bound rather than SQL-bound.

format_userlink in views/profile/blocks.tt ran once per listed user and called remote.watches / remote.trusts (or memberof) for each, every one an uncached trustmask / checkrel memcache round-trip -- ~3,000 gets for a ~1,500-relationship profile (~6s logged in). Unlike #3646 these keys are all distinct, so memoizing trustmask wouldn't help; instead the controller now loads the viewer's circle once via watcheduserids / trusted_userids / member_of_userids into {id => 1} hashes and the template does an O(1) membership check.

Separately, sort_by_username recomputed display_name on every O(n log n) comparison (~31k calls, ~1s even logged out); it now uses a Schwartzian transform so each name is computed once.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

  • Trim change-narration and duplicate issue refs from the profile comments

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

1. My stomach felt almost as bad this morning when I woke up, but once I got going, I started to feel a lot better, and it wasn't like yesterday where I'd feel better for a while but then anything I ate would make me feel worse again. Not quite 100% but mostly back to normal.

2. There was another ant invasion this morning, though not nearly as bad as yesterday. I was worried that despite my precautions and clean up this morning, I might come home to more after work, since yesterday we had both been home during the day to monitor any scouts and keep things from snowballing, but with Carla out of town, there's no one to keep an eye out during the day. But the diatomaceous earth I put down this morning seems to have been enough and there were no ants in the kitchen this evening and only a couple in the dining room near where they had been coming in. So hopefully I won't wake up to ants again tomorrow.

3. When I first moved offices last year, the area I was in was the coldest in the whole building, but then they made some change and it was the warmest. It was tolerable for the winter and spring, but it's really bad now and I was just sweltering at my desk this afternoon. I put in a request to the facility maintenance department and they said they will get it looked at ASAP so fingers crossed they can get it to a more reasonable temperature.

4. Look at this sweetie girl.

print/py-frescobaldi: Update 4.0.5 => 4.0.7

Changelog:
https://github.com/frescobaldi/frescobaldi/blob/v4.0.7/CHANGELOG.md

Remove dependency on lilypond and add message for choosing the
appropriate package instead.

PR: 296487
Sponsored by: UNIS Labs
graphics/py-qpageview: Update 1.0.3 => 1.0.5

Changelog:
https://github.com/frescobaldi/qpageview/blob/v1.0.5/CHANGELOG.md

Commit log:
https://github.com/frescobaldi/qpageview/compare/v1.0.3...v1.0.5

Switch from dynamically generated by github tarball to statically
generated by upstream.

PR: 296486
Sponsored by: UNIS Labs
Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
print/py-python-ly: Update 0.9.9 => 0.9.10

Changelog:
https://github.com/frescobaldi/python-ly/blob/v0.9.10/CHANGELOG.md

Commit log:
https://github.com/frescobaldi/python-ly/compare/v0.9.9...v0.9.10

- Switch from autogenerated by github tarball to prepared by upstream.

PR: 296485
Sponsored by: UNIS Labs
Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
Page generated Jul. 8th, 2026 06:03 am
Powered by Dreamwidth Studios

Style Credit