Skip to content

Thread contention while throwing and catching exceptions #97181

@rchoffardet

Description

@rchoffardet

Description

I don't know if that's expected. Feel free to close the issue if it is.

We identified some thread contention while throwing and catching exceptions on multiple threads.
The methodology was to simply throw 10_000 exceptions in a multithreaded context. I was expecting that the CPU time spent per exception would stay relatively stable but it's increasing instead. If you do the same thing with method calls, the CPU time per calls stays flat.

Configuration

Windows 11 (10.0.22631.3007/23H2/2023Update/SunValley3)
12th Gen Intel Core i7-12700H, 1 CPU, 20 logical and 14 physical cores
.NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2

Regression?

I don't know

Data

Code

https://gist.github.com/rchoffardet/228f4bf1892e403c65487fcfe46afe35

Result

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions