Re: glib iconv caching



On Mon, 2005-08-08 at 19:06 -0400, Matthias Clasen wrote:
> On Mon, 2005-08-08 at 17:05 -0400, mortenw gnome org wrote:
> > I would guess that the reason caching was needed to begin with
> > was because of crazy code like (from g_utf8_collate)...
> > 
> >       gchar *str1_locale = g_convert (str1_norm, -1, charset, "UTF-8", NULL, NULL, NULL);
> >       gchar *str2_locale = g_convert (str2_norm, -1, charset, "UTF-8", NULL, NULL, NULL);
> > 
> > where "charset" is from g_get_charset, i.e., in practice it never
> > changes.
> > 
> > Just keeping a single iconv around here for this would do wonders
> > for efficiency.  (Similar code is found in g_utf8_collate_key.)
> > 

On second look, the iconv caching was introduced in 2002, while the
ineffient code you point out stems from 2004, so it was definitively
not the reason for doing the caching...




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