runtime: Environment.GetLogicalDrives is an order of magnitude slower on Linux compared to Windows

Environment.GetLogicalDrives is an order of magnitude slower on Linux compared to Windows

Slower diff/base Windows Median (ns) Linux Median (ns) Modality
System.Tests.Perf_Environment.GetLogicalDrives 183.88 326.14 59971.81

The contributor who wants to work on this issue should:

  1. Run this simple benchmark from dotnet/performance repository and confirm the problem
git clone https://github.com/dotnet/performance.git
python3 ./performance/scripts/benchmarks_ci.py -f netcoreapp5.0 --filter System.Tests.Perf_Environment.GetLogicalDrives
  1. Build dotnet runtime locally: https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md#Build
  2. Create a small repro app: https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md#Repro
  3. Use PerfCollect to identify issue https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-dotnet-runtime.md#PerfCollect
  4. Solve the issue

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

If it isn’t “obviously returning the wrong thing” then we can probably assume we can’t change its behavior now. As you say, it’s arguably not comparable with the work windows has to do, but nevertheless faster is better for anyone calling it…

docs links lead to 404 page

I have updated the links.

I’d like to try solve this one!

Awesome! Please let me know if something is not clear or you need some help

@GKotfis I have assigned you. thanks

I’d like to try solve this one! @adamsitnik docs links lead to 404 page. But don’t worry - I’ve found correct 😃