Hello,
The same code runs using Windows, Linux, macOS and any other PHP platform. phpdocx doesn't include OS exceptions but when using the conversion plugin (to get the correct OS paths).
We recommend you to compare the server specifications, PHP versions, op-code extensions, special configurations and other set-ups, and also test it using PHP CLI mode. The performance issue must be in the server or web set-up/specifications.
Regards.