I am profiling a PHP website that seems a little slower than it should be with XDebug.
I checked the profile information with KCacheGrind and according to that, 80% + of the load time is caused by fopen.
However, when I add statements to the code before and after the fopen call to measure how long it is taking, it does not seem to be taking even close to the 80% reported by XDebug.
This method reports that it is taking around 2 seconds to complete the fopen call, the page is taking around 25 seconds to load - a large jump from the 80% reported by XDebug.
Is it really the fopen call slowing everything down and if not, how can I find out what is?
If it is not, how can I get more accurate information from XDebug?
Edit: It seems that although the call completes, it is still counted by XDebug as "current" until the connection is closed and it hangs until it times out. After manually closing the connection the stats seem to be a bit better.