yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00294
Re: Note on optimized compilation / optimized coding / profiling results
> -The time that is really spent for mathematics and associated code is
> less than 7% for interaction geometry and less than 12% for ContactLaw
> (7 and 12 are estimates based on non-inclusive costs, i.e. time really
> spent in contact and geometry dyn libs) .
>
Bruno, these are really important numbers, many thanks. That also means
that I will not go on to vectorize (=multiplex) operations on vectors
and quaternions (addition of all 3 elements in one CPU instruction),
since that would yield very small speedups.
Recently looking at interfaces of many classes (like containers),
methods are not properly marked const if they do not change the current
instance. That, I think, prevents many optimizations. Like,
container.size() should be declared as
class container{
...
size_t size(void) const {...}
...
}
since it will never change the container.
BTW Janek, for the class index: the index could be a (really) static
variable, which would have to be allocated inside .cpp files (by some
macro, say CREATE_CLASS_INDEX(className) would expand to "int
className::index=-1", or even YADE_PLUGIN could do this for all classes
it receives), in this way the plugin _loader_ would assign the index
right after the plugin is loaded and you could get it simply by
className::index (but the index would r/w and some _stupid_ user might
fiddle with it).
Vaclav.
_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev
Follow ups
References