Apr 172012

I’m talking about performance here, same program, same compiler options, gcc on CentOS6 generate much better executable than gcc on CentOS5, the gap is 10~15%.

I think gcc makes the most difference, as changing glibc etc. does not make too many difference. It seems gcc did pretty good job from 4.1 to 4.4, I will dig into details whenever I have time.

Apr 172012

I’m a strong supporter to STL since ideally you can get rid of new/delete and malloc/free so not worry about memory leakage, sure you still need to think about resource leak but that’s much easier to debug to me.

However, I’m stuck in performance issue not with STL, I know STL does a lot of copy operation but I never imagine the performance is this bad, I think the main reason is that I use too many std::string and that kind of copy takes time, but what else can I do, move to char *? That will get back to new/delete again.

I’m running oprofile now to see if there is anything else to me optimized – the goal is 400K bytes/second, and I’m at 310K, while old pointer-rich implementation was no less than 500K. If there is nothing to to tuned I will just drop this branch and keep previous ugly but efficient codes.