Edgewall Software

Opened 10 years ago

Last modified 10 years ago

#11497 closed enhancement

Unit tests is very slow on MySQL 5.1 or later — at Version 1

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:
API Changes:
Internal 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

Change History (1)

comment:1 by Jun Omae, 10 years ago

Description: modified (diff)
Owner: set to Jun Omae
Status: newassigned
Note: See TracTickets for help on using tickets.