_ How can I solve this problem if the autoload function loads many folders and the website traffic is heavy?

Source: Internet
Author: User
The _ autoload function loads many folders, and the website traffic is heavy. does it affect the speed? _ the autoload function loads many folders, and the website traffic is heavy, does it significantly affect the speed! Function _ autoload ($ className) {if (file_exists ('Model/'. $ cl _ autoload function loads a large number of folders, and the website traffic is heavy. does it significantly affect the speed?
_ The autoload function loads many folders, and the website traffic is heavy. does this affect the speed!
Function _ autoload ($ className ){
If (file_exists ('Model/'. $ className.'. class. php ')){
Include_once ('Model/'. $ className.'. class. php ');
}
If (file_exists ('Controller/'. $ className.'. class. php ')){
Include_once ('Controller/'. $ className.'. class. php ');
}

$ Prefix = $ GLOBALS ['groupname'] = 'main '? '':'../';
If (file_exists ($ prefix. 'core/'. $ className.'. class. php ')){
Include_once ($ prefix. 'core/'. $ className.'. class. php ');
}
If (file_exists ($ prefix. 'core/Smarty-3.1.6/'. $ className.'. class. php ')){
Include_once ($ prefix. 'core/Smarty-3.1.6/'. $ className.'. class. php ');
}
If (file_exists ($ prefix. 'core/Smarty-3.1.6/sysplugins/'. $ className.'. php ')){
Include_once ($ prefix. 'core/Smarty-3.1.6/sysplugins/'. $ className.'. php ');
}

}

------ Solution --------------------
In my opinion, using _ autoload has little impact, because it only calls _ autoload to load multiple files at a time, rather than calling _ autoload to load multiple files multiple times.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.