Re: [gnome-db] gda_holder_set_value_static_str



Hi Vivien,

I'm about to start coding some improvements on symbol-db, do you think
the patch I attached can be ok? In case it isn't I'll manage to do some
other hacks using the current apis.

thanks and regards,
Massimo

Massimo Cora' wrote:
> Hi Vivien,
> 
> here it is a possible patch. I added only the function
> gda_holder_take_static_value (), in this way it's possible to use both
> strings or G_TYPE_* values.
> Putting all the values static in my test program I could gain an average
> performance of 20ms quicker than the normal method for 100 queries.
> User should then care to free the const GValue* passed to the holder and
> he must also be sure to let the holder has a valid GValue at query time.
> 
> Please review it and tell me what you think,
> 
> thanks and regards,
> Massimo
> 
> 
> 
> Massimo Cora' wrote:
>> Vivien Malerba wrote:
>>> 2008/8/25 Massimo Cora' <maxcvs email it>:
>>>> Hi Vivien,
>>>>
>>>>
>>>> while trying to optimize the speed of some queries I came on
>>>> g_value_set_static_string (), which is good and faster than its brother
>>>> g_value_set_str ().
>>>> I was wondering if it was possibile to add a
>>>> gda_holder_set_value_static_str ()?
>>> This can be done, even if it would be usefull only for GdaHolder with
>>> a G_TYPE_STRING value.
>>>
>>>> Another question, always in that fashion:
>>>> gda_holder_take_value () takes as input a *value that is freed when the
>>>> holder is re-set. That method returns TRUE if value has been set.
>>>> I was thinking about this speed improvement:
>>>> create a gda_holder_take_value_do_not_free () [well, the name is
>>>> unlucky...] that when is re-set will return the stored value instead of
>>>> freeing it. In this manner it's possible to reuse that GValue without a
>>>> g_free () and g_value_new_*().
>>> Could you provide a patch for this?
>> sure I'll try to come out with a patch ASAP.
>>
>> regards,
>> Massimo
>>
>>
>> _______________________________________________
>> gnome-db-list mailing list
>> gnome-db-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gnome-db-list
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gnome-db-list mailing list
>> gnome-db-list gnome org
>> http://mail.gnome.org/mailman/listinfo/gnome-db-list



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