On 5/15/07, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Russell Keith-Magee wrote: > > It happened around mid January, as a result of the tests that use > > fixtures. Every time a fixture test is executed, it flushes the > > contents of the database. Flushing is a slow operation. Unfortunately, > > it's also a necessary operation for those tests. > > > > I agree that the slowdown is less that ideal. I have a chat with > > Malcolm recently about possible ways to speed things up, and we didn't > > come up with any ideas that would yield any sort of significant > > speedup. Any suggestions on how to improve the situation are welcome. > > A wild suggestion: may be just drop an old database and create a new > one? Or only create new databases during tests and drop all of them at > once after?
It turns out to be slower. Flush only needs to delete data; if you drop the database entirely, you need to destroy the old database, recreate the database, and resync the database, too. Each of these is a fairly expensive operation. One thought Malcolm and I shared was that it _might_ be possible to save the state of a 'synced' database, and restore that saved state at the start of each test. My gut reaction says that this should be faster, but its not an easy thing to implement. On file-backed SQLite it would be a fairly simple file copy, but on any other backend it becomes a lot more complex. Again, suggestions welcome. Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
