Why is local deployment so slow?

Local deployments are too slow. For example the following code took 4m50.281s:

dfx deploy zon_pst --argument 'record { owner = $(FOUNDER); subaccount = null; }'
dfx deploy NacDBIndex --argument 'vec { $(FOUNDER) }'
dfx deploy CanDBIndex
dfx deploy backend
dfx deploy payments
dfx deploy zon_pst
dfx ledger fabricate-cycles --amount 1000000000 --canister backend
dfx canister call backend init '(null)'

How to make it faster?

It might work

dfx start --artificial-delay 0 --clean

“Building canisters…” is still slow, even if --artificial-delay 0.

If building takes a long time then you should look into speeding up compilation times

What should be done specifically to compile faster

Compilation is slow, but CPU usage is not high

Memory-heavy operations? Swap?