From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: default large-file-warning-threshold Date: Sun, 30 Nov 2014 21:46:38 -0800 Organization: UCLA Computer Science Department Message-ID: <547C00BE.5050506@cs.ucla.edu> References: <21606.10799.112099.788101@a1i15.kph.uni-mainz.de> <1753218.Ot8JCqssfN@descartes> <546AABCF.8030705@cs.ucla.edu> <9xioico2nm.fsf@fencepost.gnu.org> <83k32s9zm5.fsf@gnu.org> <547A4A1B.9060807@cs.ucla.edu> <20141130101201.3a2625e6@forcix> <547B4285.8070901@cs.ucla.edu> <83wq6c8s47.fsf@gnu.org> <547B9127.2080508@cs.ucla.edu> <878uismg2o.fsf@wanadoo.es> <874mtgmfiu.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1417412835 13690 80.91.229.3 (1 Dec 2014 05:47:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2014 05:47:15 +0000 (UTC) To: =?UTF-8?B?w5NzY2FyIEZ1ZW50ZXM=?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 01 06:47:08 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XvJpC-0002Jz-6o for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2014 06:47:06 +0100 Original-Received: from localhost ([::1]:52889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvJpB-0003cs-Om for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2014 00:47:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvJp2-0003cl-1M for emacs-devel@gnu.org; Mon, 01 Dec 2014 00:47:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvJou-0007hQ-Hg for emacs-devel@gnu.org; Mon, 01 Dec 2014 00:46:55 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:58430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvJou-0007hM-9i for emacs-devel@gnu.org; Mon, 01 Dec 2014 00:46:48 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 3644039E8018; Sun, 30 Nov 2014 21:46:47 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W0KBG34-lXUS; Sun, 30 Nov 2014 21:46:38 -0800 (PST) Original-Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 7E03EA60027; Sun, 30 Nov 2014 21:46:38 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: <874mtgmfiu.fsf@wanadoo.es> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178565 Archived-At: =C3=93scar Fuentes wrote: > If a feature needs to scan the whole buffer, and the scanning is > not trivial, visiting an 800 MB file would be unpleasant. If the scanning is sufficiently nontrivial, the same argument would apply= to a=20 10 MB file, no? So perhaps large-file-warning-threshold should be mode- = or=20 feature-dependent, as well as dependent on physical RAM size. I agree that Emacs is too slow when used in default mode on large text fi= les.=20 On my circa-2011 desktop if I want reasonable efficiency on a multigigaby= te text=20 file I typically use find-file-literally, because plain find-file makes m= e wait=20 for tooooo maaaannny seconds. There's no reason in principle that Emacs = must be=20 that slow on large files, it's just that performance on large files has n= ot been=20 that high a priority, and the tiny default large-file-warning-threshold i= s to=20 some extent a symptom of this. Here's a little shell script that lets me reproduce the performance probl= em, if=20 you're interested: yes '#define assume_initialized(val) asm ("" : "=3DX" (val))' | head -n 30000000 >t time emacs -Q -nw --execute '(find-file "t")' --kill time emacs -Q -nw --execute '(find-file-literally "t")' --kill On my desktop the find-file version takes 8.06 user CPU seconds and the d= elay is=20 really annoying, whereas the find-file-literally version takes only 0.04 = user=20 CPU seconds. It's like night and day.