This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Optimising C++

I've ported some code from C to C++ and I'm shocked at how much more slowly it runs. I've written a lot of C++ in the past, so I know I haven't done anything absurdly inefficient, but execution times have gone up by 150% (2.5 times slower!). Has anyone else seen anything like this? Are there any particular aspects of the Keil C++ implementation that I should look out for?

Parents
  • Well the original C code wasn't fast enough either! The 48 bit comparisons can probably be done really quickly in assembler, and wouldn't cause code bloat if inlined. I'm probably going to accelerate it in an FPGA at the end of the day.

    As for re-coding for speed, I think it's a reasonable thing to do if you get enough benefit for the effort involved. It's not the worst solution in the world.

Reply
  • Well the original C code wasn't fast enough either! The 48 bit comparisons can probably be done really quickly in assembler, and wouldn't cause code bloat if inlined. I'm probably going to accelerate it in an FPGA at the end of the day.

    As for re-coding for speed, I think it's a reasonable thing to do if you get enough benefit for the effort involved. It's not the worst solution in the world.

Children
No data