Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Ilkka Virta Newsgroups: gnu.bash.bug Subject: Re: [PATCH 5.1] zread: read files in 4k chunks Date: Mon, 22 Jun 2020 23:16:40 +0300 Lines: 16 Approved: bug-bash@gnu.org Message-ID: References: <20200622055328.155106-1-Jason@zx2c4.com> <3cac1f66-697d-396d-3dc8-fc5b621638a4@case.edu> <271ebec9-fe1f-7823-a236-2e734657a279@iki.fi> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1592857014 20964 209.51.188.17 (22 Jun 2020 20:16:54 GMT) X-Complaints-To: action@cs.stanford.edu To: chet.ramey@case.edu, "Jason A. Donenfeld" , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <3cac1f66-697d-396d-3dc8-fc5b621638a4@case.edu> Content-Language: en-US X-SASI-RCODE: 200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=CDoN0O/He8YtAuKCcpEZAclx2JjSNjFL0RbibxlMFjc=; b=mzq24ArOPuaMbZRz0Hmhu0CzOeiwJCunQUKRauGq8RrCrjszDmbC3RSm8Pza6m0mSuKv3VkzlHX6P0mXq9Q9MaGQ8SNDeY2Ih6+A0KazX06IiXwUpOCRbxEXwtskXoN5nqJ4DnwlnYboZ5YFx9joBqWZeYV/SHlKM5PzX4JYcrpu94hrzbRoIPRrbEBYW17JTYtDvcK1/1kmtV395N1TLHQUsCSJb6p00siAAePwDaih2thlGohE8OGyXwZrfR1iYLuFdkR7Mgsp2HCdkZJBcq6+X7c6Zpjx1IIBG6JzPz2qYHyURE5L6M2OknckKufYBZNPRJjrc8rP9ZKTx5rQ5Q== Received-SPF: neutral client-ip=157.24.2.104; envelope-from=itvirta@iki.fi; helo=smtp-in-2.cc.lut.fi X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/22 16:16:44 X-ACL-Warn: Detected OS = FreeBSD 8.x X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <271ebec9-fe1f-7823-a236-2e734657a279@iki.fi> X-Mailman-Original-References: <20200622055328.155106-1-Jason@zx2c4.com> <3cac1f66-697d-396d-3dc8-fc5b621638a4@case.edu> Xref: csiph.com gnu.bash.bug:16433 On 22.6. 19.35, Chet Ramey wrote: > On 6/22/20 1:53 AM, Jason A. Donenfeld wrote: >> Currently a static sized buffer is used for reading files. At the moment >> it is extremely small, making parsing of large files extremely slow. >> Increase this to 4k for improved performance. > > I bumped it up to 1024 initially for testing. It always struck me as odd that Bash used such a small read of 128 bytes. Most of the GNU utils I've looked at on Debian use 8192, and a simple test program seems to indicate glibc's stdio reads 4096 bytes at one read() call. -- Ilkka Virta / itvirta@iki.fi