A Dilluns, 4 de març de 2013 01:00:16, Cédric Krier va escriure:
> 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?

Will try to build the test case and investigate a little bit. I don't remember 
the details right now. 
 
> > 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

Agreed. But then we have a lot of work to do :) 

The patch works great and the full command I was trying finishes in just 51 
seconds. Here's the command:

./bin/trytond -d database -u country

Still, if I increase the cache size from 2000 to 20000, it finishes in almost 
half of the time: 27 seconds! At a first glance I'd guess the issue could be 
with Fs2bdAccessor.browserecord in convert.py but haven't done any tests yet.

> > 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

-- 
Albert Cervera i Areny
http://www.NaN-tic.com
Tel: +34 93 553 18 03

http://twitter.com/albertnan 
http://www.nan-tic.com/blog

-- 
-- 
[email protected] mailing list

--- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to