Skip to content

Commit 8ea1a49

Browse files
committed
[feat] optimize D_CGRAPH_PARALLEL_MICRO_BATCH_ENABLE_
1 parent 50c89a1 commit 8ea1a49

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/GraphCtrl/GraphElement/_GEngine/GDynamicEngine/GDynamicEngine.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,21 +203,8 @@ CVoid GDynamicEngine::fatWait() {
203203
#ifdef _CGRAPH_PARALLEL_MICRO_BATCH_ENABLE_
204204
CVoid GDynamicEngine::parallelRunAll() {
205205
// 微任务模式,主要用于性能测试的场景下
206-
const UThreadPoolConfig& config = thread_pool_->getConfig();
207-
CSize thdNum = config.default_thread_size_ + config.secondary_thread_size_;
208-
CGRAPH_THROW_EXCEPTION_BY_CONDITION(thdNum <= 0,
209-
"default thread size cannot smaller than 1");
210-
211206
std::vector<std::future<CStatus>> futures;
212-
CSize taskNumPerThd = total_end_size_ / thdNum + (CSize)(0 != total_end_size_ % thdNum);
213-
for (int i = 0; i < thdNum; i++) {
214-
GElementPtrArr elements;
215-
for (int j = 0; j < taskNumPerThd; j++) {
216-
auto cur = i * taskNumPerThd + j;
217-
if (cur < total_end_size_) {
218-
elements.emplace_back(front_element_arr_[cur]);
219-
}
220-
}
207+
for (auto& elements : parallel_element_matrix_) {
221208
auto curFut = thread_pool_->commit([elements] {
222209
CGRAPH_FUNCTION_BEGIN
223210
for (auto* element : elements) {

0 commit comments

Comments
 (0)