Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[6.x] Optimize Service Provider registration #30960
As per the discussion in #30952 and according to my tests,
I adapted the benchmark to test checking the default laravel packages. Benchmark code and results here: https://gist.github.com/36864/4bc70175ad0bb60b3261d1100f249cf5
Class names are unlikely to be longer than 100 characters, so this change should not have a negative impact.
According to the same benchmarks, a direct substring comparison would also be faster than the current implementation, but slower than
Sample result, over 1000000 iterations, checking if the provider class name starts with
Well, no. We are clearly in micro-optimization territory here.
But I don't see a reason for the framework to use
Further tests showed