From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Temporarily select-window, without updating mode-line face and cursor fill? Date: Wed, 05 May 2021 14:54:02 +0300 Message-ID: <83y2ct2y79.fsf@gnu.org> References: <56F746A2-B842-421E-8FBF-EA5E93EA26CE@gmail.com> <83pmya8d49.fsf@gnu.org> <904A57C8-C268-412F-815F-782017F47D5D@gmail.com> <83eeep8w0m.fsf@gnu.org> <81F181EB-D3C1-4619-B42A-1F49321EC544@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38546"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, jdtsmith@gmail.com, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 05 13:54:50 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leG78-0009vi-Od for ged-emacs-devel@m.gmane-mx.org; Wed, 05 May 2021 13:54:50 +0200 Original-Received: from localhost ([::1]:37732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leG77-000213-GJ for ged-emacs-devel@m.gmane-mx.org; Wed, 05 May 2021 07:54:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leG6Z-0001Mq-Fk for emacs-devel@gnu.org; Wed, 05 May 2021 07:54:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42536) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leG6Y-000194-Sp; Wed, 05 May 2021 07:54:14 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1877 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1leG6X-0003VM-TU; Wed, 05 May 2021 07:54:14 -0400 In-Reply-To: (message from Stefan Kangas on Tue, 4 May 2021 19:49:25 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268905 Archived-At: > From: Stefan Kangas > Date: Tue, 4 May 2021 19:49:25 -0500 > Cc: Eli Zaretskii , emacs-devel@gnu.org > > Stefan Monnier writes: > > > We really should simply speed up `line-number-at-pos`. > > It shouldn't be hard. See below what I do in nlinum.el. > > Interesting, it seems much faster at least in this simplistic test: > > (benchmark-run 100000 (line-number-at-pos)) > => (5.868677411999999 0 0.0) > > (benchmark-run 100000 (line-number-at-pos)) > => (0.9772498589999999 1 0.5954873589998897) Doesn't this measure the line number of the same position? If so, that's about as favorable benchmark for caching as possible, no?