-
Notifications
You must be signed in to change notification settings - Fork 87
[WIP] Rust rewrite + Refactor #465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
HeitorAugustoLN
wants to merge
18
commits into
nix-community:trunk
Choose a base branch
from
HeitorAugustoLN:rust-rewrite
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[WIP] Rust rewrite + Refactor #465
HeitorAugustoLN
wants to merge
18
commits into
nix-community:trunk
from
HeitorAugustoLN:rust-rewrite
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the foundation for a new CLI tool written in Rust as an efficient alternative to KDE configuration tools. This initial implementation includes: - Basic command structure with the first 'write' subcommand - Support for writing key-value pairs to config files - XDG directory handling with support for nested groups - Configuration file parsing and modification Performance benchmarks for the 'write' command: - plasma-manager: 0.00s elapsed, 2.4MB memory, 105 page faults, 8 outputs - kwriteconfig6: 0.05s elapsed, 13.4MB memory, 615 page faults, 208 outputs This first implementation achieves a ~5x speed improvement while using ~80% less memory compared to the default KDE tool. More commands will be added in future commits.
This commit adds a custom fork of the rust-ini library (kconfig-rs) that supports the nested section format used by KDE configuration files (e.g., [Section][Subsection]). It changes the section type from String to Vec<String> and updates the parser and writer accordingly. The implementation properly handles the KDE configuration format with nested sections while maintaining compatibility with standard INI files.
- Improve performance by using pre-allocated capacity in String creation - Fix Clippy warnings about inefficient string building from iterators - Replace format!().collect() pattern with direct string manipulation - Maintain identical functionality while reducing memory allocations
Implemented |
It also supports keys without groups, fixing #17. Though this still needs to be implemented in the modules to work correctly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Performance benchmarks
Performance benchmarks (with kconfig-rs)
Creating a new entry
You can start trying the new command-line interface by building it with:
nix build github:HeitorAugustoLN/plasma-manager/rust-rewrite#plasma-manager