diff options
author | Bernhard Urban-Forster <lewurm@gmail.com> | 2019-11-01 00:08:14 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-11-01 00:08:14 +0300 |
commit | 0be756d6096e07bbd90350e6d5e5e536af031b53 (patch) | |
tree | b68d7e39a704623ca70450c801beaf6664d2b7a0 /mcs/class/referencesource | |
parent | b484979aa9741673c2f820bdac7f5c925128ad9d (diff) |
[threadpool] cache processor count (#17642)
On top of https://github.com/mono/corefx/pull/369 this improves the execution time of `System.Core-xunit` on Linux/ARM64 by 2x, so from:
```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
net_4_x_System.Core_xunit-test Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 131.143s
```
to
```console
$ make -C mcs/class/System.Core run-xunit-test
[...]
=== TEST EXECUTION SUMMARY ===
net_4_x_System.Core_xunit-test Total: 48774, Errors: 0, Failed: 0, Skipped: 6, Time: 74.636s
```
This is only relevant for non-netcore. The CoreCLR folks just recently fixed something similar (thanks to Marek sharing this link): https://github.com/dotnet/coreclr/pull/27543
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r-- | mcs/class/referencesource/mscorlib/system/threading/threadpool.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs index 9a120e05c46..7fffc1fc52b 100644 --- a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs +++ b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs @@ -85,7 +85,7 @@ namespace System.Threading #if MONO public const uint tpQuantum = 30U; - public static int processorCount => Environment.ProcessorCount; + public static int processorCount = Environment.ProcessorCount; public static bool tpHosted => ThreadPool.IsThreadPoolHosted(); |