Re: mmap in php_passthru_fd in file.c ?
| From: | Rasmus Lerdorf | Date: | Fri, 18 May 2001 05:40:52 +0000 |
| Subject: | Re: mmap in php_passthru_fd in file.c ? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-55707@lists.php.net to get a copy of this message | ||
> > True. But I guess my main issue is still that the behaviour changes
> > radically based on a hidden configure check (ie. whether mmap is there
> > or not) and that ensuring a block-by-block read in user space is
> > inefficient for huge files.
> >
>
>
> good point... hrrmmm....
>
> it seems like this is an option that should be available (somehow), yet
> I don't really like adding another option to the function, as it
> requires too much "smarts" on the behalf of the user (at what point does
> mmap() slow things down instead of speed them up, what is mmap(), etc.)
Well, we do check and only do the mmap() for files larger than the block
size.
> Perhaps automatic detection could be option? if (filesize > X)
> blockread else mmap? It seems like the most intuitive way to implement
> it...
Sounds a bit magical. Why not just a block_readfile() function?
-Rasmus