Repository navigation
perf(package): hardlink duplicate web-apps files in deb and rpm - #20
Conversation
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>
chrip
left a comment
There was a problem hiding this comment.
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
Hardlink identical files under
web-appsin 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.execute_before_dh_builddebrunshardlink, andutil-linux (>= 2.38)is added toBuild-Dependshardlinkin%installafter the copy, becausecp -rdoes not keep linksCaveat: 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):
xz -9 already finds part of the duplication, so the .deb gains less than the installed size and the image do.