From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: point-at-final-line Date: Sun, 28 Jan 2018 22:36:05 +0200 Message-ID: <83o9ldiuve.fsf@gnu.org> References: <868tckgl1y.fsf@zoho.com> <87vafom6af.fsf@bsb.me.uk> <86r2qcf1h2.fsf@zoho.com> <86wp01byil.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1517171683 7919 195.159.176.226 (28 Jan 2018 20:34:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 Jan 2018 20:34:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 28 21:34:39 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eftet-0001V7-5A for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jan 2018 21:34:35 +0100 Original-Received: from localhost ([::1]:35055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eftgt-0002xH-KS for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jan 2018 15:36:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eftgJ-0002wM-Vz for help-gnu-emacs@gnu.org; Sun, 28 Jan 2018 15:36:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eftgG-0002ZN-Tv for help-gnu-emacs@gnu.org; Sun, 28 Jan 2018 15:36:04 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eftgG-0002ZI-QL for help-gnu-emacs@gnu.org; Sun, 28 Jan 2018 15:36:00 -0500 Original-Received: from [176.228.60.248] (port=4894 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eftgG-0006qw-69 for help-gnu-emacs@gnu.org; Sun, 28 Jan 2018 15:36:00 -0500 In-reply-to: <86wp01byil.fsf@zoho.com> (message from Emanuel Berg on Sun, 28 Jan 2018 19:59:14 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115873 Archived-At: > From: Emanuel Berg > Date: Sun, 28 Jan 2018 19:59:14 +0100 > > Stefan Monnier wrote: > > >> Seems to be virtually no difference > >> in performance. > > > > Try them in a very large buffer. > > How large is very large? I wrote the below zsh > to create large files that look like this: > > 1f6920fd18f25904026c59ee560f53c815dde2f854e21e40ceb3f3d58fa55ab9 > 593bc90bcecd16dada33273deb2a79e593703844ccc65a2139928124357c7755 > d43d005aeb2bd1b68e264918f99e41aa175b7a9354a171631db0038c68c59f46 > 09eab885d64735c3fcd49d650cf1d237025faf9e40ae356017c07fab9db2005c > > With 10 000 lines there was still no > difference. With 100 000 lines and a file size > of 6.2M, the results were... identical. Yes, counting lines is fast. But not counting lines is even faster. You don't need to compute the number of the current line, you just need to establish whether the line current ends at EOB. Right? And the line's end is given by line-end-position, right?