Files
odoo_source/addons/base_import/models
std-odoo 8125165b00 [FIX] base_import: improve the import speed
Purpose
=======
Since v15, the time to import records in Odoo is much slower than in
v14. With a profiling, we know that the cause is `fields_get`. Indeed,
this method is heavy and call many times (#rows * #columns * ~#batches).

So the import time (in seconds) for ~1000 leads in CRM is;

Batch size | v14 | v15 | v15 fix
--------------------------------
2000       |   7 |  20 |      14
 200       |  11 |  48 |      15
  20       |  17 | 423 |      23

We can see that just by calling `._fields.get` instead of `fields_get`
we gain a lot of time. The reason for that is `fields_get` just read in
a python dictionary (which is really really fast), while `fields_get`
checks the access right, get the description of each fields (which
might make SQL queries to retrieve translation, etc).

Task-2687407

X-original-commit: 96e72a8b1657df00d5ed7ca6db7bd99e352d7096
Part-of: odoo/odoo#79913
2021-11-17 10:44:32 +00:00
..