Skip to content

Remove low-usage label icons#449

Draft
kaste wants to merge 2 commits into
gh-pagesfrom
sublimehq-label-opt
Draft

Remove low-usage label icons#449
kaste wants to merge 2 commits into
gh-pagesfrom
sublimehq-label-opt

Conversation

@kaste

@kaste kaste commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

... but proper and dynamic.

Also, for neither "apple" nor "mac" we have icons. Remove, the c family because "Jon finds them awful".

Benjamin Schaaf and others added 2 commits June 24, 2026 11:50
They also aren't included in the list of labels, so no reason to bloat
the icons for insignificant labels.

Additionally, this improves exclusions and aliases of icons. C, C# and
C++ icons look very silly next to their names, so exclude those.
Keep build-label-icons focused on shipping the complete used-label icon
set, then derive the low-usage subset during the Eleventy build. This
lets the generated labels page, search index metadata, and copied SVG
sprite agree with the current build dataset.

Also keep the manual C-family exclusions and drop the unused mac to
apple alias.
@kaste

kaste commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

Measured against static/label-icons.svg before vs after removing the C-family icons plus low-usage icons:

sprite raw gzip brotli icons
before 200.5 kB 81.8 kB 71.6 kB 141
after 113.4 kB 45.4 kB 39.9 kB 103
saved 87.1 kB 36.5 kB 31.7 kB 38

Breakdown:

  • C-family only: ~2.8 kB raw, ~0.8 kB gzip, ~0.6 kB brotli
  • Low-usage icons: ~84.2 kB raw, ~35.7 kB gzip, ~31.1 kB brotli

So the low-usage pruning is basically all of the win.

Assuming the sprite is downloaded and not already cached:

network brotli saved time gzip saved time
Slow 3G-ish, 400 kbps ~635 ms ~730 ms
Lighthouse mobile / Fast 3G, 1.6 Mbps ~160 ms ~180 ms
Decent 4G, 9 Mbps ~28 ms ~32 ms
  • This does not save a network round trip unless the request disappears entirely.
  • Cached repeat visits save nothing on network transfer, obviously.

@braver

braver commented Jul 1, 2026

Copy link
Copy Markdown
Member

Any somewhat normal website includes several images of hundreds of kilobytes each. I don't really understand why we need to save a few kilobytes here. The "search index" is so much larger, it's much easier to win milliseconds there by tweaking how or when that loads.

Alternatively, the icons file is loaded completely regardless of what icons you're looking at right now. Instead, we could consider inlining the svg content into the markup instead of referencing elements in the larger file. That way you only load what you're rendering at that point. (random internet link about this approach):

Scherm­afbeelding 2026-07-01 om 12 23 15

@michaelblyons

michaelblyons commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Any somewhat normal website includes several images of hundreds of kilobytes each. I don't really understand why we need to save a few kilobytes here. The "search index" is so much larger, it's much easier to win milliseconds there by tweaking how or when that loads.

Agree.

Alternatively, the icons file is loaded completely regardless of what icons you're looking at right now. Instead, we could consider inlining the svg content into the markup instead of referencing elements in the larger file. That way you only load what you're rendering at that point. (random internet link about this approach)

I don't know that this is best. You save the cost of the unvisited icons, but you now load the SVG bytes every place it appears in the file. And you don't get to cache the bytes across different pages with the same icon (let alone between visits where the HTML updated but the icon doesn't).

Can eleventy provide each icon as a file? You add the bytes of overhead for transferring each file, but you get to cache the files again.

@braver

braver commented Jul 1, 2026

Copy link
Copy Markdown
Member

We don’t cache any of the other the words or bits markup either. You’re talking literally about bytes at that point.

Can eleventy provide each icon as a file?

They might even start out as individual files? Not sure what the build pipeline looks like for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants