[Dbix-class] DBIx::Class::Fixtures speedup

luke saunders luke at shadowcatsystems.co.uk
Thu Apr 24 11:54:04 BST 2008


On Wed, Apr 23, 2008 at 8:42 PM, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Wed, Apr 23, 2008 at 04:37:54PM +0100, Drew Taylor wrote:
>  > >  What if you used link() instead of a copy?
>  > >
>  > >  Or just make the dump code make the tmp dir, and populate open a file handle
>  > >  to everything in advance so you don't have to worry about paths changing
>  > >  under you?
>  >
>  > As I understand your suggestion, dumping to the tmp dir wouldn't work
>  > for me because I make a dump only every so often, but populate from it
>  > many times per day as I run my tests. I just want to zip through the
>  > existing files w/o any IO other than reading/slurping the .fix files.
>
>  If dumping uses a temp dir, and populate just opens the filehandles,
>  that's exactly what you'd get.
>

Seems like a reasonable idea. My understanding here is that if a
filehandle is opened and that file is then removed, the filehandle can
still be read from. However I'm not clear on how that works,
presumably Perl doesn't read the file into memory when you first open
the handle, so what happens?

Also I don't think link() works on all platforms.



More information about the DBIx-Class mailing list