Hi there, I have a script I run through console to populate my forum application with random test data. It is supposed to create thousands of forum posts with several comments per post. The method essentially looks like this: forum = Forums.create 2000.times do forum.posts.create end I've found that it slows to a near halt after it adds a few hundred messages. What is happening here? Is there something I can do to keep the thing moving quickly? Thanks, Andrew
on 2007-06-15 06:14
on 2007-06-15 12:26
firstname.lastname@example.org wrote: > I've found that it slows to a near halt after it adds a few hundred > messages. What is happening here? Is there something I can do to > keep the thing moving quickly? Perhaps 2000.times do |i| forum.posts.create GC.start if i % 100 == 99 end -- We develop, watch us RoR, in numbers too big to ignore.
on 2007-06-15 19:38
Can you be more specific as to what your code is doing? 'essentially' doesn't help to debug as I can write a quick test to do what you posted and it takes not time at all to insert 2000 records. Chris