Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mattsu2020
Copy link
Contributor

Overview

Disable SIMD-accelerated paths when GLIBC_TUNABLES removes AVX/AVX512 so wc falls back to the naive counters.
Add hidden --debug flag output that reports whether hardware acceleration is active, disabled by tunables, or unavailable at runtime.
Cache SIMD policy decisions and reuse them within the fast path code to avoid repeated environment parsing.

Testing

cargo test -p uu_wc
cargo clippy -p uu_wc -- -D warnings
Spot-check wc -l with and without GLIBC_TUNABLES='glibc.cpu.hwcaps=-AVX2,-AVX512F'

Add CPU feature detection to conditionally use SIMD-accelerated bytecount functions for chars and lines, falling back to naive methods when SIMD is disabled by environment or unavailable on CPU. Introduce a hidden --debug flag to output SIMD status information, aiding in troubleshooting performance issues.
…lity

Swap the if-else blocks in the wc function's debug output to check for SIMD allowance first, improving code flow without changing functionality.
- Add asimd, ASIMD, hwcaps, tunables, TUNABLES to .vscode/cspell.dictionaries/jargon.wordlist.txt
- Prevents spellchecker from flagging valid technical terms used in the codebase
@mattsu2020 mattsu2020 changed the title fix(wc):GNUwc-cpu.sh fix(wc):GNU wc-cpu.sh Nov 4, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 4, 2025

CodSpeed Performance Report

Merging #9144 will degrade performances by 2.11%

Comparing mattsu2020:wc_compatibility (ead1881) with main (e84b261)

Summary

❌ 1 regression
✅ 124 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
wc_bytes_synthetic[500] 164.2 µs 167.7 µs -2.11%

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

GNU testsuite comparison:

Congrats! The gnu test tests/wc/wc-cpu is no longer failing!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should agree on a common implementation to put in uucore for it to be reused for the --debug flag of cksum (see #9088)

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.

2 participants