[PATCH v3 0/6] MR78: NSI and GetAdaptersInfo() performance improvements

Paul Gofman (@gofman) wine at gitlab.winehq.org
Tue May 17 09:17:37 CDT 2022


This is inspired by Street Fighter V game which performance has regressed in multiplayer mode since iphlpapi reimplementation on top of NSI. Speficically, the game calls GetAdapatersInfo() very often which turnaround time increased dramatically. While I was checking the effect against GetAdapatersInfo() only I hope the patchset might improve the performance of some other iphlpapi functions as well.

Here is the patch I used as a top level measure of the effect: https://gist.github.com/gofman/c08e58f15105d60b4576c9ae25bcec9d

The table below lists the times of GetAdaptersInfo() in ms measured with this test (this is the time for GetAdapatersInfo(NULL, ...) for estimating the buffer length plus actual data query call. The major difference between Machine 1 and Machine 2 is most likely in the number of ip routing table entries (8 on "Machine 2" and 4 on "Machine 1"). Windows has less interfaces and routes configured so it is probably not suitable for back to back performance comparison this way although the datapoint may still be interesting for very rough comparison. The baseline here is the performance before iphlpapi redesign (which I measured on Proton 6.3).

There are maybe more opportunities for optimization but after this patchset GetAdapatersInfo() performance is slightly improved over baseline so I stopped here for now.

```
                Machine 1       Machine 2
Windows         0.7
Proton 6.3      2.7             8.7
Current Wine    12.2            99.8
After patch 1   10.0            59.2
After patch 4   5.5             27.2
After patch 5   3.6             20.2
After patch 6   2.4             7.6
```

--
  v3: iphlpapi: Don't request unused dynamic interface data.
      nsi: Allocate a small buffer at once in NsiAllocateAndGetTable().
      nsiproxy.sys: Update interface table only if LUID is not found in convert_unix_name_to_luid().
      nsiproxy.sys: Update interface table only if LUID is not found in convert_luid_to_unix_name().
 
https://gitlab.winehq.org/wine/wine/-/merge_requests/78



More information about the wine-devel mailing list