I am working on speeding up the response time of the website I'm currently working on. Can anyone tell me if the php parser takes the time to look at the code within comment blocks, or is it completely ignored? I ask because I'm wondering if removing many large blocks of commented code would do anything to improve page rendering time. Thanks.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Search Php hip hop. Facebook uses it to compile Php to native code. Its very fast.
They're ignored. The PHP tokenizer essentially jumps right over them.
You might be able to ditch a single $2,000 server if you had Facebook's 500,000,000 users. For most sites, though, you've wasted more billable time considering the issue than you'll realize in a century's worth of cost savings.
accelerator (eaccelerator, xcache, apc or simialar) will make a big difference on big php-files.
It may be a db-related issue though. (indexes??)
Keep your comments, you will forget or someone will take over.
If you want to improve PHP performance, install bytecode cache (such as apc). That would make PHP not to recompile files every time
parse rules for "jumping" over comments are well established and extremely low-overhead. removing comments will save a miniscule sliver of processing time, but you will never notice it.
and the time consumed trying to read code without comments will be a far greater penalty down the road.