Opened 12 years ago
Closed 12 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: | |||
| Internal Changes: | |||
Description (last modified by )
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 by , 12 years ago
| Description: | modified (diff) |
|---|---|
| Owner: | set to |
| Status: | new → assigned |
comment:2 by , 12 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |



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