Re: mmap in php_passthru_fd in file.c ?

From: Date: Thu, 17 May 2001 17:54:19 +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-55709@lists.php.net to get a copy of this message
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?
Mainly the bloat factor, we already have a large core, imho, functions shouldn't be added unless there are no workarounds. Also, it requires a little too much thought, into what sizes are good for mmap() and what sizes are good for block read's (it also requires knowledge of mmap(), because many people might automatically assume that block_read would always be faster). I'm pretty sure if we polled php-general and php-qa (the more "knowledgable" user bases), most people wouldn't really understand what mmap does, or what it is for or when it is beneficial to use it. As for magical, well a bit, but good magic and internal magic (not syntactical magic). I'd assume that most systems have a certain point where mmap is no longer more beneficial than reading a file by chunks. If we can find a reasonable number (or have a user specify that in a configuration option if really necessary), it saves the user the trouble of thinking about something which is pretty low-level and it reduces bloat. I don't really see a downside to this magic. -Sterling

« previous php.dev (#55709) next »