Comment 6 for bug 1223243

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

I put a timer around the creation of the records (only the call to ir_model_data._update(), not taking into account the import stuff around. That means, in openerp.osv.orm at line 1373

                 with Timer() as t:
                     ids.append(ModelData._update(cr, uid, self._name,
                         current_module, record, mode=mode, xml_id=xid,
                         noupdate=noupdate, res_id=id, context=context))
                 _logger.debug('Create of 1 line took %.03f sec.' % t.interval)

Here is an excerpt of the debug lines I get:

2013-09-10 12:45:10,263 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.250 sec.
2013-09-10 12:45:10,704 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.210 sec.
2013-09-10 12:45:11,057 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.200 sec.
2013-09-10 12:45:11,491 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.210 sec.
2013-09-10 12:45:11,969 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.250 sec.
2013-09-10 12:45:12,458 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.250 sec.
2013-09-10 12:45:12,782 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.160 sec.
2013-09-10 12:45:13,187 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.200 sec.
2013-09-10 12:45:13,651 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.240 sec.
2013-09-10 12:45:14,131 9518 DEBUG openerp_70 openerp.osv.orm: Create of 1 line took 0.250 sec.

For an average of 0.220 seconds per line, it will take nearly 2 hours to complete the import of 30'000 lines.

The creation of move lines is very slow.