make -j4 or -j8

前端 未结 4 655
逝去的感伤
逝去的感伤 2020-12-12 20:50

I have 4 processors and am compiling processor hungry application, I read that using make with the -j4 switch was recommended for OpenCV, should I rather use -j8 and what is

4条回答
  •  Happy的楠姐
    2020-12-12 21:03

    One CPU per thread plus one manager/loader. Since a thread that does disk operations is technically almost idle from CPU point of view, add one to the total number of cores.

    If the CPU is using hyperthreading, you can safely count each core as two cores and double the number of threads, so a quad core Intel Core i7 should get -j9 (eight virtual cores plus manager.) On a quad core AMD use -j5

提交回复
热议问题