Commit d58b1ca
authored
- `CheckRunClassInitThrowing` didn't check to see if the class had been initialized before taking a lock
- `EnsureTlsIndexAllocated` didn't check if the Tls index had been allocated before setting the flag via an expensive Interlocked call to indicate that it had been allocated
- And finally `JIT_GetNonGCThreadStaticBaseOptimized` and `JIT_GetGCThreadStaticBaseOptimized` were missing the fast paths which avoided even calling those apis at all.
Perf with a small benchmark which does complex multithreaded work...
| Runtime | Time |
| ---- | ---- |
| .NET 8 | 00.9414682 s |
| .NET 9 before this fix | 22.8079382 |
| .NET 9 with this fix | 00.2004539 |
Fixes #107728
1 parent f722e5c commit d58b1ca
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
904 | 910 | | |
905 | 911 | | |
906 | 912 | | |
| |||
975 | 981 | | |
976 | 982 | | |
977 | 983 | | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
978 | 990 | | |
979 | 991 | | |
980 | 992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3797 | 3797 | | |
3798 | 3798 | | |
3799 | 3799 | | |
3800 | | - | |
3801 | | - | |
| 3800 | + | |
| 3801 | + | |
3802 | 3802 | | |
3803 | 3803 | | |
3804 | 3804 | | |
| |||
3903 | 3903 | | |
3904 | 3904 | | |
3905 | 3905 | | |
3906 | | - | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
3907 | 3911 | | |
3908 | 3912 | | |
3909 | 3913 | | |
| |||
0 commit comments