httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: performance tweak.
Date Wed, 12 Nov 1997 01:51:08 GMT
+1, thanks for spotting this. 

Dean

On Tue, 11 Nov 1997, Ben Hyde wrote:

> 
> In default_handler, avoid the mmap call, if
> we don't need the file's content.
> 
> Index: src/main/http_core.c
> ===================================================================
> RCS file: /cvs/apachen/src/main/http_core.c,v
> retrieving revision 1.135
> diff -c -r1.135 http_core.c
> *** http_core.c	1997/11/08 21:42:36	1.135
> --- http_core.c	1997/11/11 22:15:14
> ***************
> *** 1744,1752 ****
>   
>   #ifdef USE_MMAP_FILES
>       block_alarms();
> !     if (r->finfo.st_size >= MMAP_THRESHOLD) {
> ! 	/* we need to protect ourselves in case we die while we've got the
> ! 	 * file mmapped */
>   	mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
>   		    fileno(f), 0);
>       } else {
> --- 1744,1753 ----
>   
>   #ifdef USE_MMAP_FILES
>       block_alarms();
> !     if ((r->finfo.st_size >= MMAP_THRESHOLD)
> ! 	&& ( !r->header_only || (d->content_md5 & 1))) {
> !       /* we need to protect ourselves in case we die while we've got the
> !  	 * file mmapped */
>   	mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE,
>   		    fileno(f), 0);
>       } else {
> 


Mime
View raw message