Skip to content

Conversation

@WyriHaximus
Copy link

On Demand Symbol Loading using composers autoloader. The current way of pre-loading all vendor symbols is very slow. On the initial project I've added it to it takes five minutes. To bring that number down I've started hacking this PoC together to bring that number down. This PoC currently takes about 2 -3 seconds to do the same by trying to find the symbols using composers autoloader.

If this is something you'd be interested in I gladly work it out into a full feature tests and all.


$foundAutoloadFile = true;
require $autoloadFileLocation;
$autoloader = require $autoloadFileLocation;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, this is something that shouldn't have been here in first place: it is scary dangerous, as it will mix autoloading definitions of this project and the analysed one.

Also, this effectively evaluates the "files" in a target project: big issue.

@WyriHaximus this is not a flaw in your patch, but in the design of this project

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note: similar issues solved in roave/backwards-compatibility-check in Roave/BackwardCompatibilityCheck#120 - /cc @maglnet

Copy link
Collaborator

Choose a reason for hiding this comment

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

Anyway, it drills down to using the factories in Roave\BetterReflection\SourceLocator\Type\Composer\Factory\ to look up symbols.

Choose a reason for hiding this comment

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

@WyriHaximus Maybe we can work together in another patch these suggestions, hm? 👍

Copy link
Author

Choose a reason for hiding this comment

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

@carusogabriel sure what do you have in mind? Currently working on using better-reflection for class locating for this PR

@WyriHaximus
Copy link
Author

@Ocramius Just pushed more changes, is this the direction you suggested?

@Ocramius
Copy link
Collaborator

Ocramius commented Aug 7, 2019

Looks like the right direction 👍

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.

3 participants