Decent speed is achieved by "resetting" the database instead of dropping all the tables (MySQL) or the schema (PostgreSQL). This reset operation clears all the data (`DELETE FROM` and `ALTER SEQUENCE` for PostgreSQL, `TRUNCATE TABLE` for MySQL).
As the support for alternative database backend mostly moved to `trac.test` and the `EnvironmentStub`, the code in `trac.tests.functional.FunctionalTestEnvironment` has been significantly simplified.