[PR #1317] [MERGED] perf(cargo): make schemars derives optional #1321

Closed
opened 2026-01-05 14:54:53 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1317
Author: @LGUG2Z
Created: 3/3/2025
Status: Merged
Merged: 3/4/2025
Merged by: @LGUG2Z

Base: masterHead: feature/devperf


📝 Commits (1)

  • 4a80457 perf(cargo): make schemars derives optional

📊 Changes

50 files changed (+376 additions, -466 deletions)

View changed files

📝 Cargo.toml (+1 -14)
📝 justfile (+13 -4)
📝 komorebi-bar/Cargo.toml (+6 -2)
📝 komorebi-bar/src/battery.rs (+2 -2)
📝 komorebi-bar/src/config.rs (+29 -17)
📝 komorebi-bar/src/cpu.rs (+2 -2)
📝 komorebi-bar/src/date.rs (+6 -4)
📝 komorebi-bar/src/keyboard.rs (+2 -2)
📝 komorebi-bar/src/komorebi.rs (+12 -7)
📝 komorebi-bar/src/komorebi_layout.rs (+2 -2)
📝 komorebi-bar/src/main.rs (+2 -2)
📝 komorebi-bar/src/media.rs (+2 -2)
📝 komorebi-bar/src/memory.rs (+2 -2)
📝 komorebi-bar/src/network.rs (+2 -2)
📝 komorebi-bar/src/render.rs (+8 -5)
📝 komorebi-bar/src/storage.rs (+2 -2)
📝 komorebi-bar/src/time.rs (+4 -3)
📝 komorebi-bar/src/update.rs (+2 -2)
📝 komorebi-bar/src/widget.rs (+2 -2)
📝 komorebi/Cargo.toml (+3 -1)

...and 30 more files

📄 Description

This commit makes all schemars::JsonSchema derives optional. After analyzing the output of cargo build timings and llvm-lines, it was clear that the majority of the 2m+ incremental dev build times was taken up by codegen, and the majority of it by schemars.

Developers can now run cargo commands with --no-default-features to disable schemars::JsonSchema codegen, and all justfile commands have been updated to take this flag by default, with the exception of the jsonschema target, which will compile with all derives required to export the various jsonschema files.

Incremental dev build times for komorebi.exe on my machine are now at around ~18s, while clean dev build times for the entire workspace are at around ~1m.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/1317 **Author:** [@LGUG2Z](https://github.com/LGUG2Z) **Created:** 3/3/2025 **Status:** ✅ Merged **Merged:** 3/4/2025 **Merged by:** [@LGUG2Z](https://github.com/LGUG2Z) **Base:** `master` ← **Head:** `feature/devperf` --- ### 📝 Commits (1) - [`4a80457`](https://github.com/LGUG2Z/komorebi/commit/4a804572123e515c5a266f7e12de110465172fae) perf(cargo): make schemars derives optional ### 📊 Changes **50 files changed** (+376 additions, -466 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.toml` (+1 -14) 📝 `justfile` (+13 -4) 📝 `komorebi-bar/Cargo.toml` (+6 -2) 📝 `komorebi-bar/src/battery.rs` (+2 -2) 📝 `komorebi-bar/src/config.rs` (+29 -17) 📝 `komorebi-bar/src/cpu.rs` (+2 -2) 📝 `komorebi-bar/src/date.rs` (+6 -4) 📝 `komorebi-bar/src/keyboard.rs` (+2 -2) 📝 `komorebi-bar/src/komorebi.rs` (+12 -7) 📝 `komorebi-bar/src/komorebi_layout.rs` (+2 -2) 📝 `komorebi-bar/src/main.rs` (+2 -2) 📝 `komorebi-bar/src/media.rs` (+2 -2) 📝 `komorebi-bar/src/memory.rs` (+2 -2) 📝 `komorebi-bar/src/network.rs` (+2 -2) 📝 `komorebi-bar/src/render.rs` (+8 -5) 📝 `komorebi-bar/src/storage.rs` (+2 -2) 📝 `komorebi-bar/src/time.rs` (+4 -3) 📝 `komorebi-bar/src/update.rs` (+2 -2) 📝 `komorebi-bar/src/widget.rs` (+2 -2) 📝 `komorebi/Cargo.toml` (+3 -1) _...and 30 more files_ </details> ### 📄 Description This commit makes all schemars::JsonSchema derives optional. After analyzing the output of cargo build timings and llvm-lines, it was clear that the majority of the 2m+ incremental dev build times was taken up by codegen, and the majority of it by schemars. Developers can now run cargo commands with --no-default-features to disable schemars::JsonSchema codegen, and all justfile commands have been updated to take this flag by default, with the exception of the jsonschema target, which will compile with all derives required to export the various jsonschema files. Incremental dev build times for komorebi.exe on my machine are now at around ~18s, while clean dev build times for the entire workspace are at around ~1m. <!-- Please follow the Conventional Commits specification. If you need to update your PR with changes from `master`, please run `git rebase master`. By opening this PR, you confirm that you have read and understood this project's `CONTRIBUTING.md`. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:54:53 +01:00
adam closed this issue 2026-01-05 14:54:53 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1321