lando / core-next

Next generation Lando v4 runtime
https://docs.lando.dev/core/v4
GNU General Public License v3.0
3 stars 4 forks source link

Proposal: Improving Command Execution Efficiency in Lando #67

Open yolcuiskender opened 3 months ago

yolcuiskender commented 3 months ago

Hi there, Lando Team!

First off, I want to extend a big thank you for the incredible work you've put into developing and maintaining Lando. It's truly a game-changer in our workflows, and I'm grateful for your efforts.

I wanted to bring up a point for discussion regarding command execution efficiency within Lando. When working with tools like this, we often find ourselves running numerous commands, especially during tasks like running tests.

Take the PHP plugin, for example. I frequently need to execute commands like Behat tests, and I've noticed something interesting in my workflow.

While it's possible to use lando php to run commands like lando php -v, many of us tend to go this route instead of using docker exec directly against the container. However, there's a noticeable overhead when using Lando commands compared to executing the same commands directly against the container.

Here's a quick comparison of execution times for the php -v command:

Using time lando php -v:

real    0m2.074s
user    0m0.373s
sys     0m1.832s

Directly against the container time docker exec -it --user www-data contentkit_appserver_1 php -v

real    0m0.190s
user    0m0.019s
sys     0m0.082s

As you can see, there's almost a 2-second difference, which can add up over time and impact productivity.

So, I'd like to suggest a potential solution. What if we could introduce a way to execute commands more swiftly? For instance, maybe adding a flag like --fast (lando --fast php) could help bypass this overhead intentionally. Alternatively, we could explore other methods to achieve similar efficiency gains.

I understand that implementing such enhancements may come with challenges, but I believe it could significantly improve the user experience with Lando.

Thank you for considering my proposal, and keep up the fantastic work!

pirog commented 3 months ago

@yolcuiskender the tl;dr response is this is one of the chief concerns for Lando 4.