C++ Optimize if/else condition

后端 未结 5 676
耶瑟儿~
耶瑟儿~ 2021-02-07 05:02

I have a single line of code, that consumes 25% - 30% of the runtime of my application. It is a less-than comparator for an std::set (the set is implemented with a Red-Black-Tre

5条回答
  •  野性不改
    2021-02-07 05:27

    I don't have an answer per se - just a couple of ideas:

    1. If you're using GCC, I'd run some benchmarks with parallel mode enabled
    2. Are you sure that you're not dealing with denormalized numbers for the cost component?

提交回复
热议问题