Skip to content

feat: Add custom containers and expand command implementations - #10

Merged
caomengxuan666 merged 1 commit into
mainfrom
develop
Feb 20, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
develop

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

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.And actually,cmd works more fluent than current powershell.

   ## 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
caomengxuan666 merged commit cfe75a2 into main Feb 20, 2026
8 checks passed
caomengxuan666 added a commit that referenced this pull request Mar 24, 2026
 feat: Add custom containers and expand command implementations
caomengxuan666 added a commit that referenced this pull request Oct 26, 2026
Merge winx3-xargs #1318-#1323 (probes 46/46 green, i18n #10 paired)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant