-2

I'm not used to ask question on forum but this one is out of my scope.

Here is my discovery :

  • php performances are way different on depending of OS.

Here is the experiences :

  • I used a brand new Laravel projet from the official documentation (I guess you can do the same with Symfony or even any PHP projet)
  • I used a profiler Laravel debugbar (I guess you can use any profiler you want or even browser inspector)
  • I deployed the projet on Windows, MacOs and Linux virtual machine (linux VM is hosted by the same PC than the one for the test on Windows)
  • I tried with the same PHP configuration
  • I disabled windows defender
  • I tried with PHP NTS and TS on all machines

Here are the results :

  • The loading basic page of the dashboard takes around
    • 200ms on Windows
    • 20ms on MacOs
    • 20ms on Linux Virtual machine
  • Basical Windows is 10 times slower than the others OS
    • This is related to the performance os the CPU since Linux VM is 10X times faster than Windows on the same machine

Here is my guess :

  • PHP build are different depending of the OS (of course) and the one for Windows is defensively not as performante as the others (sad story)
  • Windows use something on top of PHP that makes it slower.

Here are my questions :

  • What is causing that lack of performances on Windows ?
  • Is it possible to run PHP faster on Windows ?

Please give constructive answer :

  • Windows is bad is not an answer
  • Windows use services that slower PHP execution without giving any name of services nor program is not a constructive answer.
  • Giving more tests to do to get interring result is a constructive answer.

Thank you for your help

  • A test on a single instance of each OS doesn't make for statistically significant evidence – ADyson Sep 28 '22 at 08:10
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 28 '22 at 10:12

1 Answers1

0

Maybe this answer can solve your problem. The different file system on Windows and Unix/Linux.

php window 4~5 times slower in windows than linux

gzhh
  • 1
  • 2
  • Thanks for the answer. Actually yes php function mike is_dir and realpath are way slower on Windows due to it way to manage files. – Olivier Sep 28 '22 at 12:54