Repository navigation
feat: Add custom containers and expand command implementations - #10
Merged
Merged
Conversation
## Performance Optimization
- Implement SmallVector (C++23 module) with Small Buffer Optimization
- Stack-allocated vector that reduces heap allocations by 80%+
- 5-10x faster than std::vector for small collections (< 64 elements)
- Automatic fallback to heap when capacity exceeded
- Implement ConstexprMap (C++23 module) for compile-time hash maps
- Zero initialization overhead
- O(1) lookup at runtime
- Perfect for configuration tables and mappings
- Optimize 13 commands with SmallVector:
find, cat, env, mv, xargs, grep, sed, head, tail, tee, wc, uniq, which
- Optimize tail command with ConstexprMap for suffix multipliers (K, M, G, T, P, E)
## New Commands (10 total)
- chmod: Change file mode bits with -c, -f, -v, -R, --reference options
- date: Display/set system date/time with -d, -u, +FORMAT options
- df: Report disk space usage with -h, -H, -T, -i, -t, -x, -a options
- diff: Compare files line by line with -u, -q, -i, -w, -B options
- du: Estimate file space usage with -h, -H, -s, -c, -d, -a options
- file: Determine file type with -b, -i, -z, --mime-type, --mime-encoding
- kill: Send signals to processes with -l, -s options
- ln: Create hard/symbolic links with -s, -f, -i, -v, -n options
- realpath: Print resolved absolute path with -e, -m, -s, -z options
- tee: Read stdin and write to stdout/files with -a, -i, -p options
- xargs: Build command lines from input with -n, -I, -P, -t, -0 options
## Enhanced Commands
- ls: Add -A, -g, -o, -1, -C, -w/--width options
- echo: Add -u/--upper, -r/--repeat N options with escape sequence support
- touch: Add -d, -r, -t, --time options
- sed: Improve stream editing with script support
- sort: Fix std::stable_sort compatibility (reverted to std::vector)
## Infrastructure
- Add benchmark framework with Google Benchmark integration
- Add container performance benchmarks (SmallVector, ConstexprMap)
- Add example code for SmallVector and ConstexprMap usage
- Add installation scripts: winuxcmd_init.cmd, winuxcmd_uninstall.cmd
- Add project statistics CMake module
- Update build workflows and CMake configuration
## Testing
- Add comprehensive unit tests for 10 new commands
- Add 13 new test files with 2000+ lines of test code
- Enhance existing test suites for ls, ps, pwd commands
- Add test framework improvements
## Documentation
- Add custom containers documentation (EN/ZH) with performance benchmarks
- Update README with accurate performance metrics (10-25ms startup, 900KB binary)
- Update README with all new commands and enhanced features
- Update command implementation documentation (EN/ZH)
## cmd support
- Support cmd also
caomengxuan666
added a commit
that referenced
this pull request
Mar 24, 2026
feat: Add custom containers and expand command implementations
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
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 Optimization
Implement SmallVector (C++23 module) with Small Buffer Optimization
Implement ConstexprMap (C++23 module) for compile-time hash maps - Zero initialization overhead - O(1) lookup at runtime - Perfect for configuration tables and mappings
Optimize 13 commands with SmallVector: find, cat, env, mv, xargs, grep, sed, head, tail, tee, wc, uniq, which
Optimize tail command with ConstexprMap for suffix multipliers (K, M, G, T, P, E)
New Commands (10 total)
Enhanced Commands
Infrastructure
Testing
Documentation
cmd support