mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
Currently, upon execution `ng` will load all description files AND code for all available commands. This requires a large amount of unnecessary file access and processing since only at most one command will be executed. This change limits the loading to only command being executed in the common case and a subset of commands in the event an alias is used. The help command now loads all commands during its execution which is needed to gather command description information. Further improvements are possible by only loading the necessary metadata instead of the execution code (and its dependencies) as well. This change allows for savings of ~250ms per execution. Examples: Before -- `./node_modules/.bin/ng version 0.99s user 0.17s system 113% cpu 1.020 total` After -- `./node_modules/.bin/ng version 0.70s user 0.13s system 110% cpu 0.749 total` Before -- `./node_modules/.bin/ng g c a 1.91s user 0.30s system 111% cpu 1.996 total` After -- `./node_modules/.bin/ng g c a 1.62s user 0.27s system 110% cpu 1.715 total`