• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Iterate Suite: best practice?

Explorer ,
Nov 07, 2018 Nov 07, 2018

Copy link to clipboard

Copied

Hi !

I'm facing two choices:

A. doing 4 to 75 iterations with the iterate suite, each one containing a for loop of around 10 000 loops

B. doing a for loop for the 4 to 75 loops, then inside that, iterating the 10 000 tiny things i need to do.

Which one is best? does it even matter? Is too much iterations are worse than a few?

Thanks for letting me know if you have a clue !

Gab

TOPICS
SDK

Views

449

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 08, 2018 Nov 08, 2018

when dealing with multithreading, the best performance is not always the

most efficient algorithm mathematically, but the algorithm that can be best

split between cores.

if you can find a way to break the "huge" chunk into smaller tasks that can

be run in parallel, then you should get a big improvement in performance.

Votes

Translate

Translate
Community Expert ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

if i had to guess, it sounds like little iterations with a big loop inside

would have less overhead.

the trick would be to utilize the optimal amount of threads. too little and

you're not using all the machine's available power. to much and the threads

queuing would slow performance down.

in that respect, 4 threads sounds like too little threads for a workstation

to perform to it's full potential.

why not just test?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

Thanks Shachar,

I'll do some performance test and post the results here.

also, the second loop is not always huge. it can vary between 10 and 10 000. so I guess at some point, all the threads can have finish their jobs and waiting for the last one to finish his huge task.

maybe there's a way to split all the tasks in an even amount of work.. let's see with some tests, as you say

Gab

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

LATEST

when dealing with multithreading, the best performance is not always the

most efficient algorithm mathematically, but the algorithm that can be best

split between cores.

if you can find a way to break the "huge" chunk into smaller tasks that can

be run in parallel, then you should get a big improvement in performance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines