Skip to content

try_par_for_each_in may have avenues for perf improvements #117169

Closed
@oli-obk

Description

@oli-obk
Contributor
          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)

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 25, 2023
added
I-slowIssue: Problems and improvements with respect to performance of generated code.
S-blockedStatus: Blocked on something else such as an RFC or other implementation work.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Oct 25, 2023
Zoxc

Zoxc commented on Mar 9, 2024

@Zoxc
Contributor

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%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parallel-compilerArea: parallel compilerI-slowIssue: Problems and improvements with respect to performance of generated code.S-blockedStatus: Blocked on something else such as an RFC or other implementation work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Zoxc@oli-obk@rustbot

        Issue actions

          `try_par_for_each_in` may have avenues for perf improvements · Issue #117169 · rust-lang/rust