From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#75342: [PATCH] Speed up asynchronous man page fontifying Date: Sat, 04 Jan 2025 11:33:18 +0200 Message-ID: <614.684754849293$1735983260@news.gmane.org> References: <86bjwnf0ge.fsf@gnu.org> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20491"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75342@debbugs.gnu.org, Stefan Kangas , juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 10:34:12 2025 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 1tU0Xr-0005Ae-Vb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 10:34:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU0Xl-00028g-Gv; Sat, 04 Jan 2025 04:34:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tU0Xi-000288-QX for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 04:34:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tU0Xi-0000F0-Hs for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 04:34:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=H2jgRTXlXMTIuqfIXFuuWWEREwJ2hTw1pmc3r2XGJ0M=; b=qyLpnJczSrNDStCSJockfRxZ6lAXe+cdMHA40hyzdxHBvCLJ3fimZJEnloVCGBvDn/m4JCQreNxgWJ3OPoMekFQNuIjUQpqnUsSNzsePyQC+vD5IuvNTbu0wowoBoPfD2YzWMZ8mNG/9v5V6pen+l8gk/03NrHzyo4yd3RWl6d+lH/ejveHvZO37mTDkmf1TX4lEUatLWAbJqHEa0yWcumT+eBBPr0AHJBt+ZLNFSOBmXC5yC7ILzg6No8pz4nomNwtH0aNvtemnATZOpNrg9kVJzIGtMEhQDBKe3QehtY4cFDkpjNnVm1nDXC4/TwTSnWHSgpCnp+uNSZLjUEsQig==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tU0Xi-0005a3-C4 for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 04:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 09:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75342 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75342-submit@debbugs.gnu.org id=B75342.173598321021410 (code B ref 75342); Sat, 04 Jan 2025 09:34:02 +0000 Original-Received: (at 75342) by debbugs.gnu.org; 4 Jan 2025 09:33:30 +0000 Original-Received: from localhost ([127.0.0.1]:53384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU0XB-0005ZF-MD for submit@debbugs.gnu.org; Sat, 04 Jan 2025 04:33:29 -0500 Original-Received: from thaodan.de ([185.216.177.71]:35874) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tU0X9-0005Yz-8w for 75342@debbugs.gnu.org; Sat, 04 Jan 2025 04:33:28 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id 1754CD00045; Sat, 4 Jan 2025 11:33:19 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1735983199; bh=SoyUnwdl6vJVnf0EZI00NOcgBF8uUVxJsG7sqWDla/A=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=lCyQQgUn2FLMkMlEOvfciCl00YNe8PnMH7iKDSvQZPXT7dNa+bNkrUekjYVFfMyc3 uub9DgS6+r+c5jBFH04HC1F0XpnEtzhNLr0qkCHtx/7IFqroKBxmopOvbHvxs/tHPi 5kjR4Lk5+sNIEuKcPNb/rwvc4EGyzFJ/LhFK1Gck1ZgD/ioucvvnbJhzLN07oSWOmV oyrLHRVF6G9KXr7dxPWR419LDPsTz4Djry0fFt9Lo/gFn63HJE/JvfuYevsWXfnhKH 6zM+So7t6xpZKTjq6oxTlu4csc4zbW1kZAgL95dinaEpiwv7r/HyjwwANN8q14uM4W r/WXtLp/0k5f+fuSdgUnoxORnM6VcCZK9+ASjAV902feqYtQOanCUyvaZ0YRI8c+D1 AqDtgir2nhtUmhqzM6UNnfQ/qTkXj5bXcvh9z96FQhiVWixyKH7wkd3eDEfzEZi7T1 dwimvgsDTXSrQOjHVDpZM/jFo4JpAGls1HL9imr4q4CExGc34VvpHlAq6+ZZOcEK/j tKVZHeWTzz6SJllETcSBUmZoyoPJVVjTf1/o1OMjF5OYPwn6Mzz0xkRhelXfR5wwii sxmd55vCQWUZM2ym4FTaMytnCUA7PZacENXr1DvcoDifxdX+Rnj+zdHzVSOwBg8n2+ XARPaIP5f1GFq2Zm04N63TCg= In-Reply-To: <86bjwnf0ge.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 04 Jan 2025 10:27:29 +0200") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298347 Archived-At: Eli Zaretskii writes: >> My measurements show that 32 KiB might be a good choice, and gives a >> ~95% speedup: >> >> | Chunk size (KiB) | Completion time (s) | >> |------------------+---------------------| >> | 4 | 29.3 | >> | 8 | 18.2 | >> | 16 | 12.7 | >> | 32 | 7.4 | >> | 64 | 6.5 | >> | 128 | 5.4 | >> >> Is this the best approach to optimize something like this, or am I >> overlooking something obvious? Note that I didn't add a variable for >> the chunk size, but we could easily add one, if that'd be useful. >> >> When I set `Man-prefer-synchronous-call` to t, it takes ~1.8 seconds to >> process the same page. I guess that this is the lower bound for how >> fast we could make the asynchronous call. > > Why not make Man-prefer-synchronous-call t by default, then? The call might take longer on slower machines (or network connections) and then block Emacs until the call was done. Never block ui unless you can do avoid it.