Add test to check number of SQL query generated

60 views
Skip to first unread message

Cédric Krier

unread,
Sep 6, 2017, 11:00:08 AM9/6/17
to Tryton
Hi,

I was looking at
https://github.com/odoo/odoo/commit/81192d66d9f4a5e4847e4ad511110567f7d530ee
and I'm wondering if it is relevant to have similar tests?
I do not think we will find crazy numbers like they do but at least
looking at it make me find https://bugs.tryton.org/issue6751.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Sergi Almacellas Abellana

unread,
Sep 25, 2017, 7:20:08 AM9/25/17
to tryto...@googlegroups.com
El 06/09/17 a les 16:58, Cédric Krier ha escrit:
> Hi,
>
> I was looking at
> https://github.com/odoo/odoo/commit/81192d66d9f4a5e4847e4ad511110567f7d530ee
> and I'm wondering if it is relevant to have similar tests?
> I do not think we will find crazy numbers like they do but at least
> looking at it make me find https://bugs.tryton.org/issue6751.
>
I don't think it's worth the effort. Indeed every optimization will make
the test fail.

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Jérémy Mousset

unread,
Sep 28, 2017, 4:29:26 AM9/28/17
to tryton-dev
Hi,

I like the idea of having tests on performances. I'm not sure if checking the max number of queries for a given operation is the best way to do it though. (as in some cases several small queries can be faster than a single large one). It may be better than nothing though.

Sergi Almacellas Abellana

unread,
Sep 28, 2017, 6:14:23 AM9/28/17
to tryto...@googlegroups.com
El 28/09/17 a les 10:29, Jérémy Mousset ha escrit:
> Hi,
>
> I like the idea of having tests on performances.

Testing performance is always a good idea. The problem is introducing it
on unit test as it can fail for some cases but you will want to accept
the change. Also we should update the test case for each improvement.

I'm not sure if checking the max number of queries for a given operation
is the best way to do it though. (as in some cases several small queries
can be faster than a single large one). It may be better than nothing
though.

The problem is what to measure, as probably the performance will depend
on the hardware, os and other unknown variables. For me the way to go
will be probably something like python speed [1] but this seems a lot of
effort.


[1] https://speed.python.org/changes/
Reply all
Reply to author
Forward
0 new messages