Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

#11497 closed enhancement (fixed)

Unit tests is very slow on MySQL 5.1 or later

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 0.12.6
Component: database backend Version:
Severity: normal Keywords: test mysql
Cc: Branch:
Release Notes:

Improve performance of unit tests on MySQL 5.1 or later

API Changes:

Description (last modified by Jun Omae)

If database backend is MySQL 5.1 or later, unit tests is very slow.

reset_mysql_db in trac/test.py executes TRUNCATE TABLE for tearDown of each test. This TRUNCATE TABLE is very slow on MySQL 5.1 or later. We use TRUNCATE TABLE because we need to reset auto_increment value of tables.

It would be fast to use DELETE FROM for table with no auto_increment rather than TRUNCATE TABLE.

Proposed changes can be found in [ca0130ae/jomae.git].

Results;

Before After
0.12-stable with MySQL 5.0.95 113.387s 85.090s
0.12-stable with MySQL 5.1.71 1359.702s 323.143s
0.12-stable with MySQL 5.5.35 788.180s 253.629s

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by Jun Omae

Description: modified (diff)
Owner: set to Jun Omae
Status: newassigned

comment:2 Changed 5 years ago by Jun Omae

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed in [12530] and merged to 1.0-stable and trunk in [12531-12532].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.