From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: default large-file-warning-threshold Date: Mon, 01 Dec 2014 17:52:29 +0200 Message-ID: <83egsj8j0i.fsf@gnu.org> 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> <547C00BE.5050506@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1417449185 15194 80.91.229.3 (1 Dec 2014 15:53:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2014 15:53:05 +0000 (UTC) Cc: ofv@wanadoo.es, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 01 16:52:58 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 1XvTHQ-0006DG-6O for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2014 16:52:52 +0100 Original-Received: from localhost ([::1]:60667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvTHP-0006Mq-Ss for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2014 10:52:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvTH5-0006Mk-DI for emacs-devel@gnu.org; Mon, 01 Dec 2014 10:52:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XvTGz-000236-Fp for emacs-devel@gnu.org; Mon, 01 Dec 2014 10:52:31 -0500 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:49633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XvTGz-00022u-7H for emacs-devel@gnu.org; Mon, 01 Dec 2014 10:52:25 -0500 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NFW00L00UETRG00@mtaout25.012.net.il> for emacs-devel@gnu.org; Mon, 01 Dec 2014 17:48:04 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFW00M87UK4CC00@mtaout25.012.net.il>; Mon, 01 Dec 2014 17:48:04 +0200 (IST) In-reply-to: <547C00BE.5050506@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 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:178583 Archived-At: > Date: Sun, 30 Nov 2014 21:46:38 -0800 > From: Paul Eggert > > yes '#define assume_initialized(val) asm ("" : "=X" (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 delay is really annoying, whereas the find-file-literally version takes only 0.04 user CPU seconds. It's like night and day. You are measuring here the one-time (per file) overhead of scanning through the entire 1.5GB file in order to detect any non-ASCII characters. Doing that at 5 nanoseconds (which should be something like 10 or 15 machine instructions) per byte is very reasonable for the 2011 vintage CPU, don't you agree? > There's no reason in principle that Emacs must be that slow on large files, it's just that performance on large files has not been that high a priority Maybe this isn't high on our priority, but even if it were, I doubt that the speed of decoding could be significantly increased. We did optimize it in 24.4 for ASCII and UTF-8 files. And of course, the time it takes to read a file into a buffer is not the most important measure: editing operations on such huge files are at least as important, if not more important. I think there's much more place for optimization in the editing operations than in the visiting department.