Re: [gnome-db] libgda-v4 performance problems



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Vivien,

Vivien Malerba wrote:
> 2008/4/7 Johannes Schmid <jhs jsschmid de>:
> 
> I've just had a quich look at the code, and here is what I can think of:
> * avoid creating a GdaSet for the parameters everytime
> sdb_engine_add_new_file() is called (reuse the same one once created),
> you can also keep references to the individual GdaHolder objects
> within the GdaSet if you want. You can also create a unique GdaSet
> object which contains all the parameters for all the statements you
> have in the plugin, and use it everytime (only set the values which
> need to be set), have a look at the bottom of create_table_object() in
> gda-meta-store.c


well, simple but good idea! Yes making it global may avoid to create and
destroy everytime the GdaSet for every statement.
I would probably prefer taking a GdaSet reference for every statement
parsed, so there won't be the problem of lookup GdaHolders (if I
understood correctly GdaSet uses a GSList internally): in case of many
parameters, as in our example, it would need to iterate with a bad
performance.

> * you can use gda_holder_take_value() instead of
> gda_holder_set_value() followed by gda_value_free().

I'll have a look at this too

> * putting all the queries within one single transaction is usually
> _much_ faster with SQLite (maybe more than 10 times faster)
> 

do you mean that we should avoid the transactions? I thought it was
faster, at least with others db it is...


thanks and regards,
Massimo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFH+8TicfVTgMRILk0RAkznAJ9KEzrrQp0+pUblIsRohJPtpx5s4ACfc6q+
p0Aa/wz2xmwJ/HIMq5hassw=
=UYID
-----END PGP SIGNATURE-----


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