fix(ngcc): do not run in parallel mode if there are less than 3 CPU cores (#36626)
fix(ngcc): do not run in parallel mode if there are less than 3 CPU cores (#36626)

Previously, ngcc would run in parallel mode (using the
`ClusterExecutor`) when there were at least 2 CPU cores (and all other
requirements where met). On systems with just 2 CPU cores, this meant
there would only be one worker process (since one CPU core is always
reserved for the master process). In these cases, the tasks would still
be processed serially (on the one worker process), but we would also pay
the overhead of communicating between the master and worker processes.

This commit fixes this by only running in parallel mode if there are
more than 2 CPU cores (i.e. at least 2 worker processes).

PR Close #36626

ocombe/angular,blesh/angular,gkalpak/angular,gdi2290/angular,IdeaBlade/angular,JiaLiPassion/angular,gdi2290/angular,gkalpak/angular,angular/angular,mgechev/angular,brandonroberts/angular,mgechev/angular,mgechev/angular,alxhub/angular,mgechev/angular,matsko/angular,IdeaBlade/angular,alxhub/angular,angular/angular,gdi2290/angular,matsko/angular,blesh/angular,manekinekko/angular,IdeaBlade/angular,blesh/angular,angular-indonesia/angular,manekinekko/angular,JiaLiPassion/angular,filipesilva/angular,ocombe/angular,gkalpak/angular,brandonroberts/angular,matsko/angular,angular/angular,shairez/angular,matsko/angular,alxhub/angular,shairez/angular,brandonroberts/angular,matsko/angular,ocombe/angular,gdi2290/angular,angular-indonesia/angular,gnomeontherun/angular,gnomeontherun/angular,blesh/angular,shairez/angular,wKoza/angular,wKoza/angular,shairez/angular,brandonroberts/angular,wKoza/angular,filipesilva/angular,blesh/angular,wKoza/angular,ocombe/angular,gnomeontherun/angular,alxhub/angular,brandonroberts/angular,gnomeontherun/angular,JiaLiPassion/angular,angular/angular,IdeaBlade/angular,angular-indonesia/angular,manekinekko/angular,angular-indonesia/angular,shairez/angular,ocombe/angular,mgechev/angular,gkalpak/angular,IdeaBlade/angular,filipesilva/angular,alxhub/angular,manekinekko/angular,manekinekko/angular,brandonroberts/angular,gdi2290/angular,manekinekko/angular,filipesilva/angular,ocombe/angular,wKoza/angular,filipesilva/angular,JiaLiPassion/angular,gdi2290/angular,wKoza/angular