← Back to team overview

yade-dev team mailing list archive

Re: Note on optimized compilation / optimized coding / profiling results

 

Václav S(milauer said:     (by the date of Mon, 25 Feb 2008 22:50:34 +0100)


> Just change that in the header and make it public, no problem. If the
> "user" screws stuff, it it his problem, not mine. I think Olivier liked
> having lot of stuff private, but then we have overheads for for
> accessors.

if accessor methods are in *.hpp file they are ALWAYS inlined, and
there is zero overhead in call: the function call is directly
translated into direct variable access. Go ahead and test this by some
benchmark. Or even examine the produced assembly code, AFAIK there
was some flag to g++ to save assembly result in text file (not
binary).

Another thing: we should inline many methods :)


> Sadly, c++ has no way to say: this member is public for
> reading and private for writing, which could help in many cases.

Hm, there is a mutable keyword. But it wasn't intended for this sort
of use - I'm not sure if this would work correctly.


best regards
-- 
Janek Kozicki                                                         |
_______________________________________________
yade-dev mailing list
yade-dev@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-dev



References