From owner-freebsd-bugs@FreeBSD.ORG Mon Aug 16 02:30:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FA1516A4CF for ; Mon, 16 Aug 2004 02:30:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3711E43D49 for ; Mon, 16 Aug 2004 02:30:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7G2UMTp086708 for ; Mon, 16 Aug 2004 02:30:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7G2UM3h086705; Mon, 16 Aug 2004 02:30:22 GMT (envelope-from gnats) Resent-Date: Mon, 16 Aug 2004 02:30:22 GMT Resent-Message-Id: <200408160230.i7G2UM3h086705@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Ponte Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59F7B16A4CE for ; Mon, 16 Aug 2004 02:21:48 +0000 (GMT) Received: from lakermmtao01.cox.net (lakermmtao01.cox.net [68.230.240.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9C9B43D31 for ; Mon, 16 Aug 2004 02:21:47 +0000 (GMT) (envelope-from dcp1990@styx.flinkpoyd.homeunix.com) Received: from styx.flinkpoyd.homeunix.com ([68.226.93.87]) by lakermmtao01.cox.net (InterMail vM.6.01.03.02.01 201-2131-111-104-103-20040709) with ESMTP <20040816022146.OJNK15934.lakermmtao01.cox.net@styx.flinkpoyd.homeunix.com>; Sun, 15 Aug 2004 22:21:46 -0400 Received: by styx.flinkpoyd.homeunix.com (Postfix, from userid 1001) id 797EE409E; Sun, 15 Aug 2004 22:21:46 -0400 (EDT) Message-Id: <20040816022146.797EE409E@styx.flinkpoyd.homeunix.com> Date: Sun, 15 Aug 2004 22:21:46 -0400 (EDT) From: Dan Ponte To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: uau@users.sourceforge.net Subject: bin/70511: When fread()ing with buffering turned off, many syscalls invoked. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dan Ponte List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2004 02:30:22 -0000 >Number: 70511 >Category: bin >Synopsis: When fread()ing with buffering turned off, many syscalls invoked. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 16 02:30:21 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Dan Ponte >Release: FreeBSD 5.2.1-RELEASE-p9 i386 >Organization: Unix Users Anonymous >Environment: System: FreeBSD styx.cox.net 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #7: Thu Jul 1 13:17:08 EDT 2004 dcp1990@styx.cox.net:/usr/obj/usr/src/sys/STYX i386 Python 2.2.2 >Description: When calling fread and buffering turned off, a read() syscall is made for each byte. With large limits, this may take a while and is very inefficient. >How-To-Repeat: In python, enter the following command: t=file('bigfile', 'r', 0).read(10000000) , replacing 'bigfile' with a large file. Notice how it takes a while to run. Now, start Python with truss and enter the same, and notice the flood of read() syscalls. >Fix: Change __srefill() in stdio to read blocks at a time, instead of one byte. >Release-Note: >Audit-Trail: >Unformatted: