April 16, 2026
3:05 p.m.
When a For-Each loop iterates over a SAFEARRAY, bypass the IEnumVARIANT COM vtable dispatch and copy lements directly from the array data. This eliminates the COM call overhead and one intermediate VariantCopy per iteration.
It is a bit surprising that COM call overhead is noticeable. Indirect calls are not free, but we use them for each opcode anyway, so I would expect the savings to be lost in the noise. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10515#note_136525