mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-11-22 00:21:43 +01:00
This commit optimizes the objc2 dependency tree by disabling default features and enabling only the minimal set of features actually used by the codebase. This reduces compilation time and dependency bloat. I was meant to do this earlier but during the initial implementation it was easier to just pull in everything. Now that we are getting ready for a public release it's time to improve on this. I ended up: * Removing unused direct dependencies: - objc2-core-services - objc2-core-video * Setting `default-features = false` on all objc2 crates and added only the specific features required for the types and methods used * Updating objc2, objc2-app-kit, objc2-foundation, objc2-application-services, objc2-core-foundation, objc2-core-graphics, and objc2-quartz-core with minimal feature sets After all those changes, the following transitive dependencies are no longer pulled in: objc2-metal, objc2-core-image, objc2-core-data, objc2-cloud-kit, objc2-core-text, and loads of unused Foundation/AppKit class bindings. Some before and after numbers: | Metric | Before | After | Change | |---------------------------------|---------|---------|----------| | objc2 dep lines (komorebi) | 84 | 50 | -40.5% | | objc2 dep lines (komorebi-bar) | 91 | 59 | -35.2% | | Dependency tree (komorebi) | 973 | 917 | -5.8% | | Dependency tree (komorebi-bar) | 1181 | 1131 | -4.2% | | Clean build time | 3m 05s | 2m 21s | -23.8% | The almost 24% reduction in clean build time is a big win!