ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/map-prefetch.ext
(Generate patch)

Comparing deliantra/maps/perl/map-prefetch.ext (file contents):
Revision 1.1 by root, Mon Jun 26 15:41:12 2006 UTC vs.
Revision 1.4 by root, Mon Jun 26 15:44:47 2006 UTC

7use Errno (); 7use Errno ();
8use Time::HiRes; 8use Time::HiRes;
9use Fcntl; 9use Fcntl;
10use IO::AIO; 10use IO::AIO;
11 11
12# find all potential exit paths, this is slow, so this info is cached
12sub find_exits { 13sub find_exits {
13 my ($map) = @_; 14 my ($map) = @_;
14 15
15 my %exit; 16 my %exit;
16 17
54 55
55 aio_open $path, O_RDONLY, 0, sub { 56 aio_open $path, O_RDONLY, 0, sub {
56 my ($fh) = @_ 57 my ($fh) = @_
57 or return; 58 or return;
58 aio_readahead $fh, 0, -s $fh, sub { 59 aio_readahead $fh, 0, -s $fh, sub {
59 my $stop = Time::HiRes::time; 60 my $time = Time::HiRes::time - $NOW;
60 warn "$path ", $stop-$NOW; 61 warn "LONG PREFETCH $path $time\n" if $time > 0.3;
61 }; 62 };
62 }; 63 };
63 } 64 }
64} 65}
65 66

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines