On 15 Mar 2001, Lars Gullik Bjønnes wrote:

> John Levon <[EMAIL PROTECTED]> writes:
> 
> | Doing lyx -x lyx-quit big.lyx,  the attached patch
> | gives the following results (warm cache, error around 4%) :
> | 
> | user (s)        | sys (s)       | elapsed (s)           |
> | ----------------------------------------------------------------------
> | 28.33 (0.00%)   | 0.30 (0.00%)  | 29.61 (0.00%)         | newinsetsold
> | 24.29 (-14.27%) | 0.32 (6.61%)  | 25.92 (-12.48%)       | newinsetsnew
> | 
> | and the binary is only 14k bigger (with -g -O). This seems worth it to me.
> 
> I don't want this patch yet.
> 
> If you have lines like:
> 
>         do_something(with_this.size());
> 
> and widh_this.size() is inlined and do_something segfaults, the
> segfault can look like it happened inside with_this.size(). 

and this is reason enough to not have this speedup ??

> Also when having inlines in the header file, alway put the inlined
> method after the class definithin with an inline, in the class inline
> should not be used:

ok, sorry

> #ifdef INLINE_SIMPLE_METHODS
> #define INLINE inline
> #include "foo_inlines.h"
> #endif
> 
> foo_inlines.h:
> INLINE
> Foo::size() {
>         return ...;
> }
> 
> foo.C:
> #ifndef INLINE_SIMPLE_METHODS
> #define INLINE
> #include "foo_inlines.h"
> #endif

well as described, if not inlined this will have copies of Foo:size()

Also I don't think IMHO it makes sense to inline hardly-used accessor methods
(or maybe it does). I suppose it depends on architecture what kind of effect
this will have on .text size

thanks
john

-- 
"24-hour boredom
I'm convicted instantly"
        - Manic Street Preachers

Reply via email to