SilveR316 Posted September 8, 2009 Share Posted September 8, 2009 Hello all, I've been exploring performance issues in PHP quite heavily lately. I'm writing a framework that will be used for a large number of projects and I need it to be absolutely as quick as it can be while retaining full feature support. I wrote my own timer class that can be used to time certain parts of my code. I have optimized pretty much everything that can be, and the framework runs extremely quickly (under 150ms to generate a full page). However, the thing that currently takes up the most time is file includes. I understand that I can compile the files most commonly used in to one big file and just include that, but my issues arises from dynamically included files based on their class name (ex ClassOneTwoThree maps to Class/One/Two/Three.php). During my testing, I include close to 80 files to get the framework running. On my Windows based machine (tested xp/vista/7), including 80 files takes about 150ms. On my linux machine running an ext3 file system, this only takes 30-40ms. This is just the raw include() function, it does not count the whole class name to file conversion going on before it. Both systems do not use any type of caching (apc or anything else like that). My question is, why is there such a huge difference in performance between Windows and Linux? I recently got a set of solid state disks in RAID 0 installed, and it makes no difference on Windows (haven't tested linux on it yet). I know I'm being nit picky about such a small amount of time, but this has been bugging me for a while. I'm just curious if anyone else has experienced anything like this before? Quote Link to comment Share on other sites More sharing options...
corbin Posted September 8, 2009 Share Posted September 8, 2009 Is it the actual including that does it or the parsing of the class name to a file name? Quote Link to comment Share on other sites More sharing options...
SilveR316 Posted September 8, 2009 Author Share Posted September 8, 2009 No, its the actual including. I'm not including the parsing time in those times I posted. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.