improve the weight assignment algorithm for compute time based balancing
(cherry picked from commit 2b052c2a9c8edb26eff6a43926128a33cb08a523)