From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46859: 28.0.50; [PATCH]: Add option to truncate long lines in xref.el Date: Thu, 04 Mar 2021 11:24:30 +0200 Organization: LINKOV.NET Message-ID: <87czwf9sq9.fsf@mail.linkov.net> References: <87im69uzlt.fsf@mail.linkov.net> <878s74fv27.fsf@mail.linkov.net> <4119ea3055ef8f306fc0@heytings.org> <4119ea30557ef84ca190@heytings.org> <7eb7ee0f-7dba-c90d-cb58-af42c3828643@yandex.ru> <4119ea30554b406efbbf@heytings.org> <4119ea30558f1e4145b0@heytings.org> <4119ea30555e80bdcf7e@heytings.org> <1c82e582-8b90-f3c5-5391-1e88ca4e7ab2@yandex.ru> <875z282el0.fsf@mail.linkov.net> <9d87da5b-e30e-149d-a467-a2c4c752a60e@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20016"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Gregory Heytings , 46859@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 04 11:18:30 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lHl3u-00055y-Rl for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Mar 2021 11:18:30 +0100 Original-Received: from localhost ([::1]:58842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHl3r-0005Xk-TN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Mar 2021 05:18:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHl2W-0003Kx-8J for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHl2U-0001pr-DH for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHl2U-0007nC-7w for bug-gnu-emacs@gnu.org; Thu, 04 Mar 2021 05:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Mar 2021 10:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46859 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46859-submit@debbugs.gnu.org id=B46859.161485298529869 (code B ref 46859); Thu, 04 Mar 2021 10:17:02 +0000 Original-Received: (at 46859) by debbugs.gnu.org; 4 Mar 2021 10:16:25 +0000 Original-Received: from localhost ([127.0.0.1]:57775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHl1s-0007lh-PD for submit@debbugs.gnu.org; Thu, 04 Mar 2021 05:16:24 -0500 Original-Received: from relay12.mail.gandi.net ([217.70.178.232]:46963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHl1r-0007lE-DX for 46859@debbugs.gnu.org; Thu, 04 Mar 2021 05:16:23 -0500 Original-Received: from mail.gandi.net (m91-129-96-116.cust.tele2.ee [91.129.96.116]) (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id E9D55200015; Thu, 4 Mar 2021 10:16:14 +0000 (UTC) In-Reply-To: <9d87da5b-e30e-149d-a467-a2c4c752a60e@yandex.ru> (Dmitry Gutov's message of "Thu, 4 Mar 2021 04:50:48 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201370 Archived-At: >> Reusing visited files is a nice feature, but still needs a fix. >> Test case: visit emacs/src/xdisp.c and type >> C-x p g expose_frame RET >> See that not all lines from xdisp.c have font-lock highlighting. >> After applying this patch, all xref output lines from xdisp.c >> have font-lock faces: > > I thought about this, but applying font-lock rules is not exactly a trivial > action. So I figured we better avoid it (and only call syntax-propertize > when necessary) to get the best performance possible. > > Have you tried benchmarking with and without your patch? Particular case of > interest: many files, each already visited, with 1 match in each of > them. Or few matches. > > The opposite would be one file with many matches inside of it. This case > should be relatively inexpensive for this patch, but it's worth measuring > to compare too. > > P.S. The "(unless syntax-needed" guard in the proposed patch is not needed. ;; Without patch (benchmark-run 10 (project-find-regexp "expose_frame")) ;; (1.936206149 21 0.27307954999999995) ;; With patch without the "(unless syntax-needed" guard (benchmark-run 10 (project-find-regexp "expose_frame")) ;; (2.195018443 31 0.354854643) I don't know if extra font-locking is worth worse performance. But I took this idea for consistency from occur that uses 'font-lock-ensure' in 'occur-engine-line'.