Matt Wilson schrieb: > On May 15, 2:19 am, Adrian von Bidder <[email protected]> wrote: >> On Thursday 14 May 2009 20.19:53 Matt Wilson wrote: >> >>>> You should really run your tests with an in-memory sqlite database. >>>> They will be much faster. >>> I really wish I could run my tests with an in-memory sqlite database, >>> but until sqlite supports stuff like the OVERLAPS keyword and time >>> intervals, I have to use postgres. I get lots of operational errors >>> now when I try to build my tables in sqlite. >> Have you tested how much you can accelerate stuff when you run the >> testdatabase in a tablespace on a ramdisk? (Not sure: does pg keep the WAL >> in the same dir as the tablespace?) >> >> May be worth it even if it's a bit more work to set up. > > I haven't tested that because I hadn't thought about it. After > changing my code so that it doesn't create and destroy all tables > between each test, it is dramatically faster. What used to take about > five minutes now takes about 30 seconds. > > The ramdisk is an interesting idea -- where should I go to learn how > to do that? Is there support within postgres for putting the > tablespace on a ramdisk?
The nature of a ramdisk is that it appears to the user as if it's a normal disk. So there is no need for any special support in PG - all you need is to configure PG (or one instance) so that it stores the tables in the volume the ramdisk appears as. However, this might be a non-trivial task, because you need to automatize parts of the installation of PG to re-do them on every test-run (or at least once per machine startup) To be frank, I don't consider it a viable idea. Re-creating the schema once before the testsuite runs should be enough - and take a few seconds at most. Running individual tests while developing doesn't need that to do anyway. Diez --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

