Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pre-Rector 1.0] - Faster and lighter DI container with Laravel #8120

Closed
TomasVotruba opened this issue Aug 6, 2023 · 5 comments
Closed
Labels

Comments

@TomasVotruba
Copy link
Member

Currently, the Symfony container pulls http-kernel and creates cached and compiled container on every test run. This leads to extreemely slow tests and downgrade of full range of symfony/* packages we don't need. I wrote about this topic here:

I want to make an experiment on performance speed, memory load and /vendor downgrade size in 2 scenarios:

  • current Symfony DI
  • lightweight Laravel container

If the later proves well, we can switch to it like we did in ECS last week. That resulted in 4 time faster tests:

https://twitter.com/VotrubaT/status/1683576139049058304


Let's see how the speed goes in here :)

@TomasVotruba TomasVotruba changed the title Pre-Rector 1.0 - container slim fit [Pre-Rector 1.0] - Faster and lighter DI container Aug 6, 2023
@staabm
Copy link
Contributor

staabm commented Aug 6, 2023

That would be awesome. I remember one of the PRs I did in the past had to workaround slow symfony kernel caching/cache-use.

Getting rid of it would be great

@yguedidi
Copy link

yguedidi commented Aug 6, 2023

Hey @TomasVotruba! Nice initiative!

Maybe you can give Symfony a chance, according to the component doc it's possible to build a container by adding services :)
Also, regarding the link to HttpKernel, it seem symfony/http-kernel is not required by symfony/dependency-injection.
From running composer why symfony/http-kernel we get symplify/symplify-kernel 11.1.27 requires symfony/http-kernel (6.1.*)
Did I missunderstood something?

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Aug 6, 2023

@staabm Indeed, even if illuminate/container will be too lazy, I think we can easy cache around it's build :)

@yguedidi Guess what I've been doing past 8 years :) Symfony DI is not suitable for CLI apps, despite marketing claims.
The http-kernel is not needed, but then you have to handle most of the cache yourself. So you need it or copy it :)
See:

Any PR to improve the speed is welcomed 👍

@samsonasik
Copy link
Member

@TomasVotruba I think this can be closed.

@TomasVotruba
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants