only check # of cores once in js optimizer