Skip to content

misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux

A smaller download: the program built for size (#158) (#182)

Ahmed Nefzaoui06a14beb22b9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 67acd2c3..8ffe2eb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -266,6 +266,9 @@ Each release's notes on GitHub come from its section here (`## [X.Y.Z]`, see
### Changed
+- **A smaller download** ([#158](https://github.com/anefzaoui/misterdownloadmanager/issues/158)):
+ the program is built for size, which takes the installer from 16.1 to 13.6 MB and the zips
+ from 19.3 to 15.6 MB, with the same features and the same download speed.
- **Translators: a reviewed translation is never replaced by machine translation.** A row whose
`#, machine` line a person deleted is kept by `tools/i18n/translate.py` in every case (`--redo`
included; a check it fails is printed for the person to decide), and CI fails a pull request
diff --git a/Cargo.toml b/Cargo.toml
index 11ae30c0..56deba25 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -138,105 +138,11 @@ codegen-units = 1
# release's symbols zip (tools/installer/symbols.py); Windows keeps it in the .pdb, which no
# download includes, and Linux and macOS strip it from the programs they ship.
debug = "line-tables-only"
-
-# Cold code optimised for size (#25): drawing the windows, fonts, images and icons, file dialogs,
-# the clipboard, the command line's parsing, crash reports. What moves the bytes (the engine,
-# torrents, TLS, hashing, tokio) and the app itself stay at full speed: with fat LTO the whole
-# program is optimised in the app's own unit, at its level.
-[profile.release.package.egui]
-opt-level = "s"
-[profile.release.package.epaint]
-opt-level = "s"
-[profile.release.package.emath]
-opt-level = "s"
-[profile.release.package.ecolor]
-opt-level = "s"
-[profile.release.package.egui_glow]
-opt-level = "s"
-[profile.release.package.glow]
-opt-level = "s"
-# Direct3D on Windows (#89): wgpu, its shader translator and its Direct3D 12 layer.
-[profile.release.package.egui-wgpu]
-opt-level = "s"
-[profile.release.package.wgpu]
-opt-level = "s"
-[profile.release.package.wgpu-core]
-opt-level = "s"
-[profile.release.package.wgpu-hal]
-opt-level = "s"
-[profile.release.package.wgpu-types]
-opt-level = "s"
-[profile.release.package.naga]
-opt-level = "s"
-[profile.release.package.egui-winit]
-opt-level = "s"
-[profile.release.package.egui_extras]
-opt-level = "s"
-[profile.release.package.winit]
-opt-level = "s"
-[profile.release.package.accesskit]
-opt-level = "s"
-[profile.release.package.accesskit_windows]
-opt-level = "s"
-[profile.release.package.accesskit_winit]
-opt-level = "s"
-[profile.release.package.accesskit_consumer]
-opt-level = "s"
-[profile.release.package.accesskit_unix]
-opt-level = "s"
-[profile.release.package.accesskit_macos]
-opt-level = "s"
-[profile.release.package.resvg]
-opt-level = "s"
-[profile.release.package.usvg]
-opt-level = "s"
-[profile.release.package.tiny-skia]
-opt-level = "s"
-[profile.release.package.svgtypes]
-opt-level = "s"
-[profile.release.package.roxmltree]
-opt-level = "s"
-[profile.release.package.kurbo]
-opt-level = "s"
-[profile.release.package.image]
-opt-level = "s"
-[profile.release.package.png]
-opt-level = "s"
-[profile.release.package.skrifa]
-opt-level = "s"
-[profile.release.package.read-fonts]
-opt-level = "s"
-[profile.release.package.harfrust]
-opt-level = "s"
-[profile.release.package.vello_cpu]
-opt-level = "s"
-[profile.release.package.rfd]
-opt-level = "s"
-[profile.release.package.arboard]
-opt-level = "s"
-[profile.release.package.clap]
-opt-level = "s"
-[profile.release.package.clap_builder]
-opt-level = "s"
-[profile.release.package.minidump]
-opt-level = "s"
-[profile.release.package.minidump-processor]
-opt-level = "s"
-[profile.release.package.minidump-unwind]
-opt-level = "s"
-[profile.release.package.minidump-common]
-opt-level = "s"
-[profile.release.package.breakpad-symbols]
-opt-level = "s"
-[profile.release.package.framehop]
-opt-level = "s"
-[profile.release.package.minidumper]
-opt-level = "s"
-[profile.release.package.crash-handler]
-opt-level = "s"
-[profile.release.package.mdm-crash]
-opt-level = "s"
-[profile.release.package.zip]
+# The whole program optimised for size (#158): with fat LTO it is optimised as one unit, at the
+# program's own level, so this is what decides. It took 9 MB (21 %) off the app's program and
+# 2.4 MB off the installer, for no measurable cost in a download's speed or CPU (a 2 GiB file and
+# its SHA-256 from the lab server, 10 runs each: 5.2 s CPU before, 5.4 s after, within the
+# runs' spread; the time is the disk's). "s" keeps loops vectorised ("z" doesn't).
opt-level = "s"
# Hashing is unusably slow unoptimised (a 3 MiB SHA-256 took seconds in debug tests): build
diff --git a/ROADMAP.md b/ROADMAP.md
index a1859649..e110dcde 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -13,6 +13,8 @@ Everything below ships together, in one release.
### Done
+- ✅ A smaller download: the installer 15 % and the zips 19 % smaller, nothing removed
+ ([#158](https://github.com/anefzaoui/misterdownloadmanager/issues/158))
- ✅ Linux: MDM's first window opens seconds sooner; the system's fonts are looked up all at once
while it starts, not one by one in the window (on a busy computer that froze it, part of
[#164](https://github.com/anefzaoui/misterdownloadmanager/issues/164))