Env: Improve install performance #23175
Labels
[Status] In Progress
Tracking issues with work in progress
[Tool] Env
/packages/env
[Type] Performance
Related to performance efforts
Is your feature request related to a problem? Please describe.
Look at the install WordPress step of
wp-env start
:gutenberg/packages/env/lib/wordpress.js
Lines 69 to 149 in db1c89b
There are two issues here:
rm
on the docker run command, which means we start and stop the service for each command.As you can imagine, this has a big performance overhead.
Describe the solution you'd like
I tested some changes to this which decreased
wp-env start
from >30s to <10s. Essentially, we can join most of these commands together into one run command. This is how it would look in plain bash as an example; we'd just generate it in JS:On top of that, we can remove the
rm
option for many of these commands, since there is no need to stop the service until we are done running everything.The only challenge I noticed while testing this is that we may need to run the install portion of the script separately from the other commands. Otherwise, it seems to error out.
Describe alternatives you've considered
Echo each wp-config value into the PHP file manually without going through wp-cil. (does not seem like a good idea)
cc @epiqueras
The text was updated successfully, but these errors were encountered: