On 04/03/13 00:27 +0100, Albert Cervera i Areny wrote: > Currently RECORD_CACHE_SIZE is found in const.py. But today, trying to > improve > the performance when updating modules in the database, I found that > increasing > the size from 2000 (the default) to 20000 (probably 7000 would have already > worked) made a huge difference. > > Updating the country module in a database with Spanish language installed > went > from more than ten minutes (didn't let it finish) o 60 seconds. > This is the second time I found that increasing this value has an important > impact on performance (previous was sale orders with a huge number of lines), > so I propose to make this value configurable in trytond.conf.
Please could you elaborate what was wrong on sale?
> Maybe the default value could also be changed from 2000 to 8000, so a very
> standard module such as country can be installed without huge performance
> degradation.
Increasing ressources to fix performance issue should always be the last
solution (and should be seen as a failure).
Here, I think the issue is about having the right order of the list of
records instead of having more in memory. If the number was bigger like
you propose, we will never find such issues.
Finaly, I don't like options (we should try to reduce them):
- they are hard to explain how to use them
- they prevent to find preformence issues
- they make bugs harder to reproduce
> PS: The reason that there's such a huge difference is that importing the .po
> files we have a dictionary which accesses randomly to all ir.translation
> records of the module. As the access is random, the system keeps querying the
> database all the time. A value of 8000 ensures all records fit in memory and
> thus no trashing occurrs. Maybe the algorithm can be changed to access the
> database sequentially and access the .po randomly.
Should be improved with http://codereview.tryton.org/701002
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgp2JKMGYNGG6.pgp
Description: PGP signature
