yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00303
Re: Note on optimized compilation / optimized coding / profiling results
> Note that getBaseClassIndex() is 10 times slower that getClassIndex(), I
> wonder why...
>
getBaseClassIndex creates an instance of the base class at every call,
getClassIndex just returns a number. Not good. Janek, what it the
boost::serialization solution of that?
from Indexable.hpp
public: virtual int& getBaseClassIndex(int depth) \
{ \
static boost::scoped_ptr<BaseClass> baseClass(new BaseClass); \
if(depth == 1) \
return baseClass->getClassIndex(); \
else \
return baseClass->getBaseClassIndex(--depth); \
}
_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev
Follow ups
References