LearnNewsExamplesServices
Frontmatter
id9036
titlePerf: Optimize GitHub Avatar Sizes
stateClosed
labels
enhancementaiperformance
assigneestobiu
createdAtFeb 7, 2026, 8:47 PM
updatedAtFeb 7, 2026, 8:53 PM
githubUrlhttps://github.com/neomjs/neo/issues/9036
authortobiu
commentsCount1
parentIssue8930
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 7, 2026, 8:53 PM

Perf: Optimize GitHub Avatar Sizes

Closed v12.0.0 enhancementaiperformance
tobiu
tobiu commented on Feb 7, 2026, 8:47 PM

Optimize GitHub avatar image loading by appending the s (size) query parameter to avatar URLs.

Goal: Reduce bandwidth usage by requesting appropriately sized images instead of full-resolution originals.

Changes:

  1. src/component/GitHubUser.mjs:
    • Display size is 32px.
    • Append &s=64 (for 2x DPI) to avatarUrl_.
  2. src/component/GitHubOrgs.mjs:
    • Display size is 20px.
    • Append &s=40 (for 2x DPI) to avatar_url.

Logic:

  • Check if URL already has query parameters (it usually does, e.g., ?v=4).
  • Append &s=SIZE or ?s=SIZE accordingly.
tobiu added the enhancement label on Feb 7, 2026, 8:47 PM
tobiu added the ai label on Feb 7, 2026, 8:47 PM
tobiu added the performance label on Feb 7, 2026, 8:47 PM
tobiu added parent issue #8930 on Feb 7, 2026, 8:48 PM
tobiu referenced in commit baef338 - "perf: Optimize GitHub avatar sizes and add avatarSize config (#9036)" on Feb 7, 2026, 8:53 PM
tobiu
tobiu Feb 7, 2026, 8:53 PM

Input from Gemini 3 Pro:

✦ Optimized GitHub avatar loading and introduced avatarSize config.

  • Updated src/component/GitHubUser.mjs to use avatarSize: 64 (default) and append s parameter using URL API.
  • Updated src/component/GitHubOrgs.mjs to use avatarSize: 40 (default) and append s parameter using URL API.
  • Eliminated magic numbers by making avatarSize a configurable property.

Changes pushed to dev.

tobiu assigned to @tobiu on Feb 7, 2026, 8:53 PM
tobiu closed this issue on Feb 7, 2026, 8:53 PM