On Fri, Feb 15, 2002 at 05:38:42PM +0100, Jean-Marc Lasgouttes wrote:
> Andre> please -- char * const) instead of the enum to identify the
> Andre> channel. The only drawback might be speed. But if that becomes
> Andre> a problem (which I seriously doubt), one could put the strings
> Andre> in a hash.
> 
> Yes, this could work.

It works...
 
> Andre> [Have you seen anybody complaining about mathed speed lately? I
> Andre> am using a much less optimized structure than Alejandro, and
> Andre> yet it is not too slow.]
> 
> In which cases should it be slow?

All the time. I guess we have a performance degradation of about one or
two orders of magnitude compared with the old code.

(1) MathAtom, which is more or less a wrapper around a  'MathInset *' with
value sematics always does _deep_ copies instead of using reference
counting and copy-on-write. 

(2) Most of the enums used by old mathed are gone or are used not as often,
almost every of the more sophisticated insets have a 'name_' member instead
of the old 'LM_OT_*' enums.

(3) sizeof(MathCharInset) == 68. Plus the overhead for heap management...

Yes, most of it could be improved or even fixed if necessary. Nobody has
complained so far, so I guess, it's not noticable.

Premature optimization is the root of all evil...

Andre'

-- 
André Pönitz .............................................. [EMAIL PROTECTED]

Reply via email to