ChildProcess is very slow with x86 executables on arm macs

3+ seconds for the most basic commands that should be < 0.02 seconds. Best I can tell Rosetta is doing the x86 → arm translation every time instead of only the first time and using the cache after that.

From what I can tell, we have little to no control over the Rosetta 2 process. It sounds like its doing AOT translation instead of JIT but I can’t find any docs on the Apple Developer site on any API’s that let us influence this decision.

My work around is using std::system but it has the downside I can’t kill the child process if it hangs.