Compare performance of 2 machines
See the question and my original answer on StackOverflowNot sure what you need exactly, but the Windows Experience Index (the one visible for end user) uses an API called WinSAT: Windows System Assessment Tool. The documentation entry point is available here: Windows System Assessment Tool.
Here is an example here: How to get the Windows Experience Index