(Requires investigation)
This issue reflects an issue found on the following issues:
I tried the two method of installaion on my computer (6core,3.6Ghz). trainning and predicting with the same datasets(one million samples and 150 features). two method have different CPU occupancy. the detail info as follow:
CMake+MinGW:
trainning cost 560 seconds (CPU occupancy is 70%)
testing cost 44 seconds (CPU occupancy is 50%)
Visual Studio:
trainning cost 547 seconds (CPU occupancy is 100%)
testing cost 23 seconds (CPU occupancy is 100%)


- (probably missed more issues)
We have to find out why there is such discrepancy between Visual Studio and MinGW.
Even worse is MinGW compilation leading to a way less CPU usage during training, but ending only slightly slower than Visual Studio which is taking 100% CPU.
MinGW vs Visual Studio is a known issue with OpenMP especially for xgboost in Windows. One can look there: dmlc/xgboost#2243
Reported in issue dmlc/xgboost#2165. Dynamic scheduling of OpenMP loops involve
implicit synchronization. To implement synchronization, libgomp uses futex
(fast userspace mutex), whereas MinGW uses kernel-space mutex, which is more
costly. With chunk size of 1, synchronization overhead may become prohibitive
on Windows machines.
Solution: use 'guided' schedule to minimize the number of syncs
Possible theory: perhaps threads are locked in Visual Studio (so they are hot), while MinGW is freeing them when possible with OpenMP (cold cores). This would lead to MinGW compiled LightGBM having less CPU usage due to higher synchronization/overhead costs (explaining why it is slower) while Visual Studio compiled LightGBM would keep the cores "ready" for training (but both behaviors are unexplained so far).
(Requires investigation)
This issue reflects an issue found on the following issues:
We have to find out why there is such discrepancy between Visual Studio and MinGW.
Even worse is MinGW compilation leading to a way less CPU usage during training, but ending only slightly slower than Visual Studio which is taking 100% CPU.
MinGW vs Visual Studio is a known issue with OpenMP especially for xgboost in Windows. One can look there: dmlc/xgboost#2243
Possible theory: perhaps threads are locked in Visual Studio (so they are hot), while MinGW is freeing them when possible with OpenMP (cold cores). This would lead to MinGW compiled LightGBM having less CPU usage due to higher synchronization/overhead costs (explaining why it is slower) while Visual Studio compiled LightGBM would keep the cores "ready" for training (but both behaviors are unexplained so far).