TL; DR; Set realpath_cache_size to> 1000
Edit 2:. The problem is resolved in this PR: try setting the value of PHP for real._cache_size to> 1000. Recently a symfony requirement has been added that fixes this problem: https://github.com/sensiolabs/SensioDistributionBundle/commit/cf0179711b24d84d4a29d71a4010540f4c990bd8
Edit: I just saw this answer: https://stackoverflow.com/a/312616/2122/ and it reduced the page generation time by 4 when I set realpath_cache_size = 4096k to my php.ini (!)
Old answer:
So, I compared both with webgrind:
In windows (fast computer) called app_dev.php:

So, you can see that the web toolbar shows the generation time of 764 ms (increased due to xDebug and profiling, but still relevant). Webgrind shows:
- 651 call file_exists () for 232 ms (which is a lot!)
- 603 calls to filemtime () (211ms)
- 230 calls for UniversalClassLoader-> loadClass () (119ms)
- 230 calls for UniversalClassLoader-> findFile () (38 ms)
On Linux (slow computer) app_dev.php:

298 ms of total generation time (which is more than half that on windows).
- 237 calls to UniversalClassLoader-> findFile () (36ms => 4 times less)
- 237 calls to UniversalClassLoader-> loadClass () (20ms => 2 times less)
- 623 calls for file_exists () (only 4 ms !!!)
- 605 calld to filemtime () (only 4 ms !!!)
The problem is that file_exists () and filemtime () are much slower than on Linux. On Windows, PHP searches for files with file_files, filemtime, loadClass, or findFile in 60% of cases. Is this a known issue?
Edit: the problem only occurs for the dev environment, there are no file files in production, since everything is cached.
Nanocom Oct. 14 2018-11-12T00: 00Z
source share