-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Starting a process on M1(ARM) CPU is 10 times slower than on Intel CPU #67591
Comments
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process Issue DetailsDescriptionI noticed that starting and running a process on M1 (ARM) CPU is 10 times slower than on Intel CPU. ConfigurationI made measures on MacOS on MBP16 Intel and MBP16 M1 Max (both are the latest available models at the moment). I run using System.Diagnostics;
using System.Text;
Console.WriteLine("Start processes");
Run(16, "/bin/ls");
void Run(int count, string fileName)
{
var stopWatch = Stopwatch.StartNew();
for (var i = 0; i < count; i += 1)
{
RunProcess(fileName);
}
Console.WriteLine($"Total {stopWatch.Elapsed.TotalMilliseconds}");
}
void RunProcess(string fileName)
{
var stopWatch = Stopwatch.StartNew();
using (var process = new Process())
{
process.StartInfo = new ProcessStartInfo
{
FileName = fileName,
UseShellExecute = false,
RedirectStandardOutput = true,
ErrorDialog = false,
CreateNoWindow = true,
RedirectStandardInput = true,
StandardOutputEncoding = Encoding.UTF8,
};
process.Start();
var output = process.StandardOutput.ReadToEnd();
process.WaitForExit();
}
Console.WriteLine($"{fileName}: {stopWatch.Elapsed.TotalMilliseconds}");
} DataIntel (2.5 ms avg)
M1 (25ms avg)
P.S. You might be interested in seeing the roots of that issue: #67506
|
I assume you don't see such a difference if you just run the commands from the shell and time how long they take to invoke? |
@EgorBo may be I'm missing something, but the 'Apple M1 Max' processor on your screenshot is marked as 'Same'. |
Sorry I didn't notice you were talking about M1 specifically |
@DanPristupov can you observe the same difference if you run these commands from shell? |
Intel (3ms):
M1 (4ms):
Is that what you ask? |
Description
I noticed that starting and running a process on M1 (ARM) CPU is 10 times slower than on Intel CPU.
Configuration
I made measures on MacOS on MBP16 Intel and MBP16 M1 Max (both are the latest available models at the moment).
I run
/bin/ls
as an example, but it can be any other process, for example/bin/date
Data
Intel (2.5 ms avg)
M1 (25ms avg)
P.S. You might be interested in seeing the roots of that issue: #67506
The text was updated successfully, but these errors were encountered: