Skip to content

feat(true/false): add benchmarks for startup performance#10996

Open
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:feat/true-false-benchmarks
Open

feat(true/false): add benchmarks for startup performance#10996
naoNao89 wants to merge 1 commit intouutils:mainfrom
naoNao89:feat/true-false-benchmarks

Conversation

@naoNao89
Copy link
Contributor

Add benchmarks for true/false commands to measure startup performance. Includes both function call and process spawn benchmarks.

Closes #10837

@oech3
Copy link
Contributor

oech3 commented Feb 17, 2026

I think --help/--version in not needed since they are not frequently used.

@oech3
Copy link
Contributor

oech3 commented Feb 17, 2026

while someone might use true any strings via dummy symlinks.

@naoNao89 naoNao89 force-pushed the feat/true-false-benchmarks branch 2 times, most recently from 425649c to 578c129 Compare February 17, 2026 16:00
@naoNao89
Copy link
Contributor Author

oke

├─ false_consecutive_calls    188.8 µs      │ 312.7 µs      │ 228.1 µs      │ 229.5 µs      │ 100     │ 100
├─ false_no_args              2.073 µs      │ 8.998 µs      │ 2.218 µs      │ 2.36 µs       │ 100     │ 200
├─ false_spawn_no_args        2.022 ms      │ 10.3 ms       │ 2.737 ms      │ 3.181 ms      │ 100     │ 100
├─ false_spawn_with_args      1.964 ms      │ 21.17 ms      │ 3.123 ms      │ 4.002 ms      │ 100     │ 100
├─ false_uu_app_construction  83.68 µs      │ 1.522 ms      │ 102 µs        │ 127.6 µs      │ 100     │ 100
╰─ false_with_args            2.171 µs      │ 20.25 µs      │ 2.582 µs      │ 2.886 µs      │ 100     │ 100

@naoNao89 naoNao89 force-pushed the feat/true-false-benchmarks branch from 578c129 to 909f2b4 Compare February 17, 2026 16:01
@oech3
Copy link
Contributor

oech3 commented Feb 17, 2026

We want to sacrifice performance for cold uu_app() calls for hot pathes. So we don't want to bench them.
(In other words, bench for hot pathes are used to block accidentaly re-adding uu_app to hot pass by refactoring by someone)

Add benchmarks to evaluate true/false command performance,
addressing GitHub issue uutils#10837.

Benchmarks include:
- Function call benchmarks (measure uumain directly)
  * true_no_args, true_help, true_version, true_consecutive_calls
- Process spawn benchmarks (measure real command startup)
  * true_spawn_no_args, true_spawn_help, true_spawn_version

This allows comparison between hot path vs cold path performance
and internal logic vs real-world startup time.
@naoNao89 naoNao89 force-pushed the feat/true-false-benchmarks branch from 909f2b4 to 50e5eea Compare February 17, 2026 16:10
@naoNao89
Copy link
Contributor Author

oke, my changes satisfy that requirement

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.

true/false: Add benchmark

2 participants

Comments