Skip to content

perf(package): hardlink duplicate web-apps files in deb and rpm - #20

Merged
juliusknorr merged 1 commit into
mainfrom
perf/hardlink-web-apps-duplicates
Oct 23, 2026
Merged

juliusknorr merged 1 commit into
mainfrom
perf/hardlink-web-apps-duplicates

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Hardlink identical files under web-apps in both the deb and rpm packages. Editor help images are committed once per language and editor, so this saves about 190 MB installed and in the package and image downloads.

  • deb: execute_before_dh_builddeb runs hardlink, and util-linux (>= 2.38) is added to Build-Depends
  • rpm: runs hardlink in %install after the copy, because cp -r does not keep links

Caveat: replacing one help file in place on a host install changes every identical copy.

Not yet verified with a full package build.

AI-assisted: implementation drafted with an AI coding agent and reviewed by the author.

Size impact

Measured on the help tree alone (the duplicates live there):

Installed / image on disk Image download (gzip) .deb (xz -9)
Current help 480.8 → 292.1 MB 390.0 → 206.4 MB 255.6 → 187.0 MB
With web-apps#352 174.5 → 144.1 MB 132.0 → 104.1 MB 99.3 → 97.5 MB

xz -9 already finds part of the duplication, so the .deb gains less than the installed size and the image do.

Editor help images are repeated per language and editor. Linking identical files saves about 190 MB installed and in the packages.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr
juliusknorr marked this pull request as ready for review October 23, 2026 12:43
@juliusknorr
juliusknorr requested a review from rikled October 23, 2026 12:45
@chrip
chrip self-requested a review October 23, 2026 13:07

@chrip chrip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. Looks good to merge once a full packages build has gone through.

You noted this isn't verified with a full package build yet, so I built a minimal deb and rpm with the same rules in ubuntu:24.04, the image the DocumentServer packages stage uses. The Build-Depends check passes there (util-linux 2.39.3 provides /usr/bin/hardlink). The .deb stores the second copy as a hard link, and the rpm lists both paths with one inode and stores the data once. My test package was a toy, so one full build on the real tree is still worth doing.

I also looked for anything that edits web-apps files in place after install, since that would change every linked copy. documentserver-flush-cache.sh only rewrites api.js, and the package ships only api.js.tpl (Makefile:411 renames it). documentserver-static-gzip.sh writes new .gz files with gzip -kf9, so it leaves the linked files alone too.

Assisted-by: ClaudeCode:claude-opus-5-5

@juliusknorr
juliusknorr merged commit ebfc81f into main Oct 23, 2026
4 checks passed
@juliusknorr juliusknorr added this to the 9.3.8 milestone Nov 2, 2026
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.

2 participants