Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/sys/cpu: report core information and speed #30239
What version of Go are you using (
Oh, I forgot about this. A further note: It turns out that you can derive speed information from some recentish Intel CPUs with cpuid leaf 0x15, although I'm told that's sometimes wrong. Intel's chips provide a parseable speed in their brand string nearly-always, and Intel officially documented this as of ~2012. I don't know about the current state of parsing such things for AMD, or ARM.
It seems like something where a perfectly-reliable answer is probably impossible, but a reasonably good guess is probably possible, and the proliferation of partial and/or incomplete solutions in the wild is probably not great for the ecosystem. Speed is hard. Core count, on the other hand, whatever runtime's using for guessing