Home  >  Q&A  >  body text

c++ - 这段FFT程序用递归为什么多线程反而慢于单线程

黄舟黄舟2764 days ago585

reply all(2)I'll reply

  • PHPz

    PHPz2017-04-17 13:55:56

    The effect of multi-threading becomes more obvious when the workload is larger. When the volume is small, the time consumption caused by thread creation and switching will be greater than the time saved by parallel computing. Just like 1,000 people building a house is not necessarily faster than 10 people building a house, but 1,000 people building 100 houses will be faster than 10 people.

    reply
    0
  • 阿神

    阿神2017-04-17 13:55:56

    I suggest you print the time before and after the code block or function that you think is suspicious, so that you can see where the time is spent.
    Then analyze why it takes time.

    reply
    0
  • Cancelreply