Hi, attached to this mail, there is the output of scan with cppcheck. Cppcheck reports few issues about post and pre incrementation of iterators (post increment is faster) and const correctness,e.g: class A { public: bool IsOk() {return state;} // <-- cppcheck complains about a missing cont declaration bool state; }; solution: class A { public: bool IsOk() const {return state;} bool state; }; One other main stylistic issue is that it is allowed to deallocate a NULL Pointer e.g: int *p = NULL; delete p; is totally legal. I hope this is usefull for you? Best regards Ettl Martin Hi, of course, i can mail the whole output to you, if you wish? But i suggest to run it on yourself using the following commandline command: Download cppcheck at http://sourceforge.net/projects/cppcheck/ cppcheck --enable=all [src-directory] Best regards Martin -------- Original-Nachricht -------- > Datum: Mon, 22 Mar 2010 13:49:37 -0700 (PDT) > Von: Sage Weil > An: Martin Ettl > CC: ceph-devel@lists.sourceforge.net > Betreff: Re: [ceph-devel] [cppcheck] suggested a few performance improvements > Hi Martin, > > On Mon, 22 Mar 2010, Martin Ettl wrote: > > i have checked the current git head with cppcheck ( a static code > > analysis tool, http://sourceforge.net/projects/cppcheck/). It is an > > allready very powerfull tool that makes some suggestions, how to improve > > performance of the code. > > > > Here is a snipped of the scan: > > .... > > [./src/mds/MDSMap.h:236]: (possible style) Pre-Incrementing variable 'p' > is preferred to Post-Incrementing > > [./src/mds/MDSMap.h:256]: (possible style) Pre-Incrementing variable 'p' > is preferred to Post-Incrementing > > [./src/mds/MDSMap.h:263]: (possible style) Pre-Incrementing variable 'p' > is preferred to Post-Incrementing > > [./src/mds/MDSMap.h:280]: (possible style) Pre-Incrementing variable 'p' > is preferred to Post-Incrementing > > [./src/mds/MDSMap.h:291]: (possible style) Pre-Incrementing variable 'p' > is preferred to Post-Incrementing > > [./src/include/LogEntry.h:100]: (possible style) Pre-Incrementing > variable 'p' is preferred to Post-Incrementing > > [./src/ceph.cc:317]: (possible style) Pre-Incrementing variable 'p' is > preferred to Post-Incrementing > > [./src/mds/MDSMap.h:247]: (possible style) Use failed.empty() instead of > failed.size() to guarantee fast code. > > .... > > > > > > Please refer the attached patch that chanes a few of this suggestions. > > What do you think about this? Does it boost the performance? > > I don't think it'll affect performance in these cases, but stylistically > it's an improvement, so I'll apply it. > > Did cppcheck have anything else to say? > > Thanks! > sage -- GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.! http://portal.gmx.net/de/go/dsl02 -- Sicherer, schneller und einfacher. Die aktuellen Internet-Browser - jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/chbrowser