introduce IS_POSIXLY_CORRECT static - #11934
Conversation
|
Since we control the entrypoint, we could use unsafe mutable static instead: static mut IS_POSIXLY_CORRECT: bool = false;
pub fn uu_main() {
unsafe {
IS_POSIXLY_CORRECT = env::var_os("POSIXLY_CORRECT").is_some();
}
}
fn is_posixly_correct() -> bool {
unsafe { IS_POSIXLY_CORRECT }
} |
|
GNU testsuite comparison: |
8809cd0 to
d38af2c
Compare
Merging this PR will improve performance by 51.74%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | echo_consecutive_calls |
257.6 µs | 169.7 µs | +51.74% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing xtqqczze:static-posixly-correct2 (576bcc7) with main (4bae306)2
Footnotes
-
50 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(a5d6966) during the generation of this report, so 4bae306 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
d38af2c to
5652044
Compare
|
Hm, what's the benefit of these changes? For example, in |
5652044 to
576bcc7
Compare
Follow-up #11853