Skip to content

Optimize Autoloader#3964

Closed
mostafakhudair wants to merge 5 commits into
codeigniter4:developfrom
mostafakhudair:optimize-autoload
Closed

Optimize Autoloader#3964
mostafakhudair wants to merge 5 commits into
codeigniter4:developfrom
mostafakhudair:optimize-autoload

Conversation

@mostafakhudair

@mostafakhudair mostafakhudair commented Dec 4, 2020

Copy link
Copy Markdown
Contributor

Optimize Autoloader Filelocator classes

add new Autoloader method loadClassmap() that registers classmap files with autoloader

Checklist:

  • Securely signed commits

@lonnieezell

Copy link
Copy Markdown
Member

Have you been able to measure this and see if it helps at all? I only ask because I tried some other optimizations around this early on and found that PHP's file location cache is actually really good, and the gains were extremely minimal and just added complexity to the framework.

$class = str_ireplace('.php', '', trim($class, '\\'));

$mapped_file = $this->loadInNamespace($class);
$mappedFile = $this->loadInNamespace($class);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use underscore on purpose as removed in 4.1, not worth updated for conflict, see rector.php config to skip this file for check underscore to camelcase check

@MGatner

MGatner commented Jan 5, 2021

Copy link
Copy Markdown
Member

I think this has some good content but at this point I'd rather see 4.1 released first to resolve all the various discrepancies and then rebase this against it.

@mostafakhudair mostafakhudair deleted the optimize-autoload branch February 1, 2021 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants