g_intern_static_string() for type names as small optimization



Cite from  http://mail.gnome.org/archives/gtk-devel-list/2007-April/msg00216.html

"Matthias Clasen" <matthias clasen gmail com> wrote:
: On 4/27/07, Damon Chaplin <damon karuna eclipse co uk> wrote:
: : Why do the *_type_register_static() functions use
: : g_intern_static_string() for the type name?
:
: It is just a small optimization. Apps are free to use it, but it is not
: the end of the world if they don't.

Matthias (or anyone else), could you explain, what this "small
optimization" optimizes (what use-cases, on what way, etc), why and
how big win/profit gives?

P.S.  Sorry in advance if the tone/manner of this message occur not
very friendly for native English speakers.  It is not intended but
just an consequence of my poor knowledge of English.

-- 
Andrew W. Nosenko <andrew w nosenko gmail com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]