Bug #31750 mysql-test-run slow to evaluate 'if' statements
Submitted: 22 Oct 2007 13:08 Modified: 22 Oct 2007 16:01
Reporter: Patrick Crews Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Tests Severity:S3 (Non-critical)
Version:5.0, 5.1 OS:MacOS (10.4.10)
Assigned to: Magnus BlÄudd CPU Architecture:Any
Tags: mysql-test-run

[22 Oct 2007 13:08] Patrick Crews
Description:
Found that evaluation of an 'if' statement is very expensive (time-wise) for mysql-test-run.

Results are as follows:

Average run time w/ IF statement:  766.47ms
Average run time w/o IF statement:  132.7 ms

This is for a single IF statement in the .test file, and seems like significant overhead to be incurred.  Only tested on Mac OSX, but suspect this will be the same for other OS.

Writing defect per Magnus' request for tracking purposes.

How to repeat:
Use attached files:

Can put attached files into the mysql-test/suites directory and run from there.

File wIF.test uses IF statement.  Other .test file w/o.  

Files are modified from key.test of the test suite.

Suggested fix:
Look into how mysql-test-run processes 'if' to see if performance can be improved.
[22 Oct 2007 13:26] Patrick Crews
set of files for mysql-test/suite to demonstrate.

Attachment: slow_if.zip (application/zip, text), 29.61 KiB.

[22 Oct 2007 13:27] Patrick Crews
Revision:

IF processes slowly w/ 4 IF's (one that evaluates to TRUE and 3 to FALSE).

When single IF, performance is comparable to w/o IF time.