Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try_par_for_each_in may have avenues for perf improvements #117169

Closed
oli-obk opened this issue Oct 25, 2023 · 1 comment
Closed

try_par_for_each_in may have avenues for perf improvements #117169

oli-obk opened this issue Oct 25, 2023 · 1 comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. WG-compiler-parallel Working group: Parallelizing the compiler

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 25, 2023

          This does look at bit expensive. It's probably a good idea to measure the performance impact of it. It might be a better idea to write the error to a mutex / atomic instead.

Originally posted by @Zoxc in #116849 (comment)

Once we have enabled parallel-compiler by default, we can run multithreaded benchmarks of the current impl against an impl that instead writes to an AtomicBool (as Result<(), ErrorGuaranteed> is effectively just a bool)

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 25, 2023
@oli-obk oli-obk added I-slow Issue: Problems and improvements with respect to performance of generated code. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. WG-compiler-parallel Working group: Parallelizing the compiler and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 25, 2023
@Zoxc
Copy link
Contributor

Zoxc commented Mar 9, 2024

I measured the impact of the PR with 7 threads and it doesn't seem to have a significant impact.

BenchmarkBeforeAfter
TimeTime%
🟣 clap:check:unchanged0.5490s0.5488s -0.02%
🟣 hyper:check:unchanged0.1674s0.1674s -0.01%
🟣 regex:check:unchanged0.4109s0.4120s 0.26%
🟣 syn:check:unchanged0.7541s0.7546s 0.07%
🟣 syntex_syntax:check:unchanged1.8485s1.8422s -0.34%
Total3.7298s3.7250s -0.13%
Summary1.0000s0.9999s -0.01%

@oli-obk oli-obk closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code. S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. WG-compiler-parallel Working group: Parallelizing the compiler
Projects
None yet
Development

No branches or pull requests

3 participants