in reply to Slow file creator

It's not clear if you don't care about the file's content as long it has the right size, if so the code below will be quite quick.

my $req_len = shift || 100; open FH, "+>", 'test.txt'; seek FH, $req_len - 1,0; print FH 'X'; close FH;

or simpler ?

my $req_len = shift || 100; truncate 'test.txt', $req_len;
HTH