The pooljobs and scheduled_cron_jobs stuff was only used to
delay the processing of cron jobs until after the registry
was fully loaded. However this is already the case because
RegistryManager.new() only sets the flag at the end of the
init step.
The flag was named `registry.cron` but simply meant that the
registry was fully loaded and ready, so it is simpler to
rename it to `registry.ready`.
In multiprocess mode this flag is enterily irrelevant
so there is no need to selectively set it to True or
False. `registry.ready` is simpler.
bzr revid: odo@openerp.com-20121221133751-h4x670vblfr3d09e
Loading time was mesured on the loading of a second database (identical to the
first one), i.e. by passing -d xx,yy on the command line, using cProfile. The
databases were installed with sale, mrp, and the crm.
The cProfile code is commited as part of this patch and should be removed (or
maybe guarded by some command-line flag) (just as the commenting-out of the
cron startup).
The patch was also applied on top of the trunk-simple-table-stats-vmt branch
which provides SQL queries counters.
Results indicate that the number of SQL queries are reduced from about 2100 to
27. Loading time is reduced from 1.3s to 0.26s (i.e. improved by 5).
Changes:
All calls to ir_model_fields to fetch manual (custom) fields are done in a
single call (prior to instanciate all models).
Checks for empty module descriptions are not done unless we are in init or
update mode. (The behavior was the opposite, which was probably a mistake).
Some calls to ir_translation, passing en_US because there was no lang in the
context, are not done anymore.
The improved time is also a result of a change in the decimal_precision module
where precision_get fetches all digits/applications instead of one at a time
(and thus implements its own caching instead of relying on
openerp.tools.ormache).
bzr revid: vmt@openerp.com-20121211105954-lwgs5js7yw3tzghs