From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bug-reference-prog-mode slows down CC Mode's scrolling by ~7% Date: Sat, 04 Sep 2021 12:06:44 -0400 Message-ID: References: <83a6kuyysv.fsf@gnu.org> <837dfwyird.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13964"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 04 18:08:05 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 1mMYD7-0003Pl-BO for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 18:08:05 +0200 Original-Received: from localhost ([::1]:49410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMYD5-0001CE-Tc for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Sep 2021 12:08:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMYBw-0008RY-Gp for emacs-devel@gnu.org; Sat, 04 Sep 2021 12:06:52 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMYBt-0008Mk-5E; Sat, 04 Sep 2021 12:06:50 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 92E974405A1; Sat, 4 Sep 2021 12:06:46 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2D970440599; Sat, 4 Sep 2021 12:06:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1630771605; bh=7+/k5wY5qW+TCW6kGUg/slhlO5LX78OlogYDd7X55Tc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=fePM8GnNI/4gTVBNXO75uaf4H9mTJ0s1Y337Z5rwvkG2g9nNXCvYqu7jXyq8cpTmb XScZPfZfoZWdsVSZN84PPQLVx2aAg5uff8m4LNjGxGa/I4/ZG3gSEyBF7ffc7irab8 epDD7J5ZrHwKoqymGO57eKsWiwqqz4YV1zRAPgmMwJBGlfzOkqfegpQTPq1i+FH5tk stoX9kJSNJfE/gzpLmZOH/U29RyiQnTZS84PrHbU+77u7kXNLiG8hIltJ9YdvyBABu 7h0Ql5rpNPfTlqDPZpQQCvbTmKJSp+k+bpKT2BWsM61uekYB8ldZTMf5mGxkyiII6X v92vWv20c+Frg== Original-Received: from milanesa (unknown [104.247.244.135]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E88A2120494; Sat, 4 Sep 2021 12:06:44 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Sat, 4 Sep 2021 15:32:57 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:273917 Archived-At: >> > , it takes 27.9s. So it would seem the cost of having a jit-lock >> > function returning a jit-lock-bounds structure when it's not the first >> > function is high. That's using the strategy of a full refontification of >> > the "extra" regions of the buffer returned in that structure. >> How does it compare to the performance with the old/current >> jit-lock code? > That takes ~22.6s. And I guess the order makes no difference there? What about with the simpler patch that passes the bounds of the first function to the subsequent ones? I suspect this should give us something like 21.2s when the ordering is favorable and 22.6s when the ordering is not, right? > Maybe. An advantage of a small chunk size is that fontifying a single > screen can be done with a maximum 499 bytes "inefficiency" off the end > of a screen. [ Well, 499 plus the effect of increasing the specified region by rounding it up to whole lines and things like that, of course ;-) ] > If we were to increase jit-lock-chunk-size to, say 2000, more of the > next screen would be getting fontified, perhaps wastefully. Indeed, I was thinking of increasing it only to 1000. > Indeed. With jit-lock-chunk-size at 2000, time-scroll on xdisp.c takes: > > (current code): 16.4s > (new proposed code): 16.1s A larger chunk should also make the impact of the order of the functions less important (because the "excess" work returned in `jit-lock-bounds` should be largely independent from the size of the region). Stefan