Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryMappedFile.CreateNew is 12-4 times slower on Linux compared to Windows #31272

Closed
adamsitnik opened this issue Oct 23, 2019 · 2 comments
Closed
Milestone

Comments

@adamsitnik
Copy link
Member

MemoryMappedFile.CreateNew is 12-4 times slower on Linux compared to Windows. MemoryMappedFile.CreateFromFile is 3x faster so there is a chance that we are doing something wrong.

Slower diff/base Windows Median (ns) Linux Median (ns) Modality
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateNew(capacity: 10000) 12.77 2321.27 29641.41
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateNew(capacity: 100000) 12.12 2462.10 29849.96
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateNew(capacity: 1000000) 8.53 3967.32 33824.88 bimodal
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateNew(capacity: 10000000) 4.83 6632.03 32033.40 bimodal
Faster Win/Lin Windows Median (ns) Linux Median (ns) Modality
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateFromFile(capacity: 10000000) 3.68 150431.05 40823.03
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateFromFile(capacity: 1000000) 2.93 119037.20 40617.88
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateFromFile(capacity: 10000) 2.75 112842.91 41088.96
System.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateFromFile(capacity: 100000) 2.67 110914.50 41580.16 several?
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.IO.MemoryMappedFiles.Tests.Perf_MemoryMappedFile.CreateNew
  1. Build CoreFX locally: https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-corefx.md#Build
  2. Create a small repro app: https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-corefx.md#repro
  3. Use PerfCollect to identify issue https://github.com/dotnet/performance/blob/master/docs/profiling-workflow-corefx.md#PerfCollect
  4. Solve the issue
@stephentoub stephentoub transferred this issue from dotnet/coreclr Oct 23, 2019
@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 23, 2020
@JeremyKuhne JeremyKuhne added this to the Future milestone Feb 27, 2020
@JeremyKuhne JeremyKuhne removed the untriaged New issue has not been triaged by the area owner label Feb 27, 2020
@JeremyKuhne
Copy link
Member

Triage: We need to investigate, but this might be unavoidable due to platform implementation differences.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Aug 28, 2024
@adamsitnik adamsitnik modified the milestones: Future, 10.0.0 Aug 28, 2024
@adamsitnik
Copy link
Member Author

Based on the data available in dotnet/perf-autofiling-issues#40288 and dotnet/perf-autofiling-issues#40339 I can say that #105178 has addressed this issue. There is still a gap, but we use best available sys-calls now so there is very little we can do about it. Thank you again @am11 !

@dotnet-policy-service dotnet-policy-service bot removed no-recent-activity backlog-cleanup-candidate An inactive issue that has been marked for automated closure. labels Aug 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants