Re: g_intern_static_string() for type names as small optimization



On Wed, 2008-01-16 at 16:53 +0200, Andrew W. Nosenko wrote:
> 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?

As the documentation says:

"g_intern_static_string() does not copy the string, therefore string
must not be freed or modified."

When you are talking about several strings for every object, not having
to copy every one saves both time and memory.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Attachment: signature.asc
Description: This is a digitally signed message part



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