Issue 11573

Title
Improve performance generating a tree view from a wizard
Priority
bug
Status
testing
Nosy list
ced, oqueralto, pokoli, reviewbot, yangoon
Assigned to
ced
Keywords
backport, review

Created on 2022-06-20.12:06:51 by oqueralto, last changed 1 week ago by oqueralto.

Messages

Author: [hidden] (oqueralto)
Date: 2022-06-21.13:23:51

okay, so do you know why the behavior is different on 6.0 series?

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-06-21.13:06:58

Symbol has nothing to do with the record name and the RPC are cached.

Author: [hidden] (oqueralto)
Date: 2022-06-21.13:01:37

This proposal seems to work well in 6.2 and 6.4, but in 6.0 a request is still made for each line to get the uom symbol:

12172 139638432327424 [2022-06-21 10:54:20,688] INFO trytond.wsgi <JSONRequest 211@127.0.0.1 '<http://localhost:8000/demo60/>' [POST] model.product.uom.get_symbol>
12172 139638432327424 [2022-06-21 10:54:20,730] INFO werkzeug 127.0.0.1 - - [21/Jun/2022 10:54:20] "POST /demo60/ HTTP/1.1" 200 -

Maybe a change was made with symbol widget?

Author: [hidden] (oqueralto)
Date: 2022-06-21.08:47:17

After taking a look at issue7888 and making some tests, the true is that I do not see how the production module should be modified to make it work fine. May can I get some additional hints?

Author: [hidden] (oqueralto)
Date: 2022-06-20.13:17:16

Thanks for pointing me out to the right place, I will submit a patch ASAP.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-06-20.12:57:17

The production module must be updated to follow issue7888. There may be other modules with the same problem.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-06-20.12:36:28

Did you know on which changeset the performance degradation was introduced?

Author: [hidden] (oqueralto)
Date: 2022-06-20.12:06:51

I realized that the performance when generating a tree (parent, child) view from a wizard like the one generated in the OpenBOMTree become slowly. It was working fine in the 5.2 version but I tested it in the 6.0 and 6.4 and it takes more time to get the tree build.

As far as I can see, the problem is that currently a read request is made for every many2one in each row in order to get the rec_name. It shouldn't be necessary because the rec_name values are already in the tree dictionary https://github.com/tryton/production/blob/develop/bom.py#L175.

This issue does not have any impact on small bills of materials, but in the big ones it really slows down a lot the process.
traceback:

8258 139693818382144 [2022-06-20 09:33:08,593] INFO werkzeug  * Running on <http://localhost:8000> (Press CTRL+C to quit)
8258 139693584963328 [2022-06-20 09:33:14,602] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] wizard.production.bom.tree.open.create>
8258 139693584963328 [2022-06-20 09:33:14,677] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:14,679] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] wizard.production.bom.tree.open.execute>
8258 139693584963328 [2022-06-20 09:33:14,751] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:14,774] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.category.read>
8258 139693584963328 [2022-06-20 09:33:14,797] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:14,798] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:14,823] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:14,826] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:14,855] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:14,857] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product-production.bom.read>
8258 139693584963328 [2022-06-20 09:33:14,888] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:14] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,475] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] wizard.production.bom.tree.open.execute>
8258 139693584963328 [2022-06-20 09:33:20,763] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,795] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:20,815] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,816] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:20,836] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,839] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:20,866] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,867] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:20,885] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,887] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:20,906] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,907] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:20,925] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,926] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:20,945] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,946] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:20,964] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,965] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.product.read>
8258 139693584963328 [2022-06-20 09:33:20,985] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:20] "POST /demo64/ HTTP/1.1" 200 -
8258 139693584963328 [2022-06-20 09:33:20,986] INFO trytond.wsgi <JSONRequest 1@127.0.0.1 '<http://localhost:8000/demo64/>' [POST] model.product.uom.read>
8258 139693584963328 [2022-06-20 09:33:21,005] INFO werkzeug 127.0.0.1 - - [20/Jun/2022 09:33:21] "POST /demo64/ HTTP/1.1" 200 -
History
Date User Action Args
2022-06-21 13:23:51oqueraltosetmessages: + msg77195
2022-06-21 13:06:58cedsetmessages: + msg77194
2022-06-21 13:01:37oqueraltosetmessages: + msg77193
2022-06-21 09:29:20reviewbotsetmessages: + msg77161
nosy: + reviewbot
2022-06-21 09:06:47cedsetassignedto: ced
keyword: + backport, review
reviews: 443301003
status: chatting -> testing
2022-06-21 08:47:17oqueraltosetmessages: + msg77154
2022-06-20 23:12:56yangoonsetnosy: + yangoon
2022-06-20 13:17:16oqueraltosetmessages: + msg77142
2022-06-20 12:58:45cedsetcomponent: + production
2022-06-20 12:57:17cedsetmessages: + msg77139
nosy: + ced

Showing 10 items. Show all history (warning: this could be VERY long)