From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#75342: [PATCH] Speed up asynchronous man page fontifying Date: Sat, 4 Jan 2025 02:12:06 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000087444c062adcf371" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28993"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov To: 75342@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 09:13:32 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 1tTzHm-0007Pw-Cm for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 09:13:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTzHR-0004Ve-PO; Sat, 04 Jan 2025 03:13:09 -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 1tTzHL-0004Uz-CS for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 03:13:05 -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 1tTzHK-0003fl-LO for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 03:13:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=juvd7DKTWon6/hMFvxTlVZ26CYhnOcoarT/c1ERJerc=; b=tY83Y2dwk2g+3kr/JJ+QjbNtVT0m9rw3jZu2xLyX52sPAe5OwjlyuL5ticORIZKeApdiQw7wktPaEXghMaYkVxpQqlkN6wB0K0ZA76n0oWGd6kWAwFqiv1gly6HRhAW8v6F+Ab2jqWlxsbwi9T6PsSx/06XKxByEyqHA9bu9vrmyJauG9OrWxYKU7bla33x4L12iRTUNbvAjv+eRzytEFAX/t161AikHPw2eRHR1uCe0+zEzhDa4XPJtOl4geoiMycJ/KeBIkaFWkKPdHfOCFSZdHK7AT7AeO2VbaOBWRjW7gHJjkWei7qlhCXd3y28UVSDotX6YvLy0i68iWqR5vQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTzHK-0001o9-8s for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 03:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 08:13: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.17359783366881 (code B ref 75342); Sat, 04 Jan 2025 08:13:02 +0000 Original-Received: (at 75342) by debbugs.gnu.org; 4 Jan 2025 08:12:16 +0000 Original-Received: from localhost ([127.0.0.1]:53259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTzGa-0001mv-1p for submit@debbugs.gnu.org; Sat, 04 Jan 2025 03:12:16 -0500 Original-Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:58777) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTzGY-0001mh-3A for 75342@debbugs.gnu.org; Sat, 04 Jan 2025 03:12:14 -0500 Original-Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5cecbddb574so22637424a12.1 for <75342@debbugs.gnu.org>; Sat, 04 Jan 2025 00:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735978327; x=1736583127; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=juvd7DKTWon6/hMFvxTlVZ26CYhnOcoarT/c1ERJerc=; b=IUCDUKIxH5O4NWQF4SyaRS8Js7gMwe+PpeOcNSMQlck1rYK2c8SCt+4cx20I7WLZz3 nad3/E8vjjNp7vyQwl54AefZe+aowRXf96LdjVzIrwALEa7hx4/iGAfc/SsvuMje4A5y OaDIv0z28fyVc3faFMfF6V0Jx7OeStBgOarwbZaAkmbxqUL88Tg4vUh3861/CFXGjZpi MN7u35GhAbm6iWtsa8rFX5ECekG4GMyQS3XkfconDaqCIlufj5SHhais1iCv+jvYhBGa YkAhbByhyHLZguYJ6NrgoSsKzN0Vfe/UGHR+9e6159xUwzQ2VImiuL8d5s55/U/rn7vf ckDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735978327; x=1736583127; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=juvd7DKTWon6/hMFvxTlVZ26CYhnOcoarT/c1ERJerc=; b=xP+czPXA/GeG8McbQjOIiHX0193Z6pewFTNRTzvDeWT2SHYbYa10b8sGb8nz93957K B9Wtr8PxRFq4fZ/J5f0vqGe7mrHk18OmvjYSuuh0c1GaR2/9Vp7z7BgDaeAApg8UT9OX RWB2a+DggKTo+L/AoWoFTchSes/O5Qa1hGlcvU6lvXRJ9bHbyFLjK+hD4w+x251w5vQQ 8u6voA4N5yLvrVI+3/6hldcO0utzjZcI73ZvZV/1HKgwArdLuA8InJ8cklFDTmwdQrOG 6sQIL4j9mZQn6INPT2ckQeeZV/HqtaeLjF5q3LSeLRXFdf0DhjB1gAmnSMifeK+GC6y7 msMg== X-Gm-Message-State: AOJu0Yz7BUQ6tPtZ6qNbHnGJyOnUzjrBofOkecqTl5J9f5J2rXneBp7T 1zgJtmEuPw8yOtlQs9Iv7SpwQ/B+qR/lT3R3kbeV2JGlW77HB45FVNqAUPYokffSbeJdsjBdo0w JcFdJMkLBdIqJZJQOswVe804sNWnWPo3d X-Gm-Gg: ASbGncvSucH4HrkXvkrAw71miV9svQPP6RSWqtq7jLvQ8bfUKUBe/CVWgcMycKxNgNo gZEoJwc9QjfORh6LiwFRDaZGWxl8r/37aMAqXSL3Q X-Google-Smtp-Source: AGHT+IGA6YY70lTFP/NlNGRX1kqG+099ACaNPMexsWm+5dw+hJJimJ0HycAaK3rPw8MaQ4yw6P+fRAUN/ruVd7d1C6A= X-Received: by 2002:a05:6402:2346:b0:5d3:bc1d:e56b with SMTP id 4fb4d7f45d1cf-5d81ddfdf76mr39020413a12.16.1735978327147; Sat, 04 Jan 2025 00:12:07 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 4 Jan 2025 02:12:06 -0600 In-Reply-To: (Stefan Kangas's message of "Sat, 4 Jan 2025 01:22:03 -0600") 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:298337 Archived-At: --00000000000087444c062adcf371 Content-Type: text/plain; charset="UTF-8" Stefan Kangas 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 | BTW, to reproduce these measurements, try the attached. --00000000000087444c062adcf371 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Report-time-to-process-man-page.patch" Content-Disposition: attachment; filename="0001-Report-time-to-process-man-page.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f038d46a1d66e6f1_0.1 RnJvbSA0ZmQ2ZWNjM2Q1OTljZWRhYmM4MjFjMmQ4NWNjMDEwNzcwZGQ1MzdiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5rYW5nYXNAZ21haWwuY29t PgpEYXRlOiBTYXQsIDQgSmFuIDIwMjUgMDY6MDE6NTUgKzAxMDAKU3ViamVjdDogW1BBVENIXSBS ZXBvcnQgdGltZSB0byBwcm9jZXNzIG1hbiBwYWdlCgotLS0KIGxpc3AvbWFuLmVsIHwgMjEgKysr KysrKysrKysrKysrKy0tLS0tCiAxIGZpbGUgY2hhbmdlZCwgMTYgaW5zZXJ0aW9ucygrKSwgNSBk ZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL21hbi5lbCBiL2xpc3AvbWFuLmVsCmluZGV4 IDU0Y2E4Y2JhZTlmLi4zNmMxMzZkYjRhNiAxMDA2NDQKLS0tIGEvbGlzcC9tYW4uZWwKKysrIGIv bGlzcC9tYW4uZWwKQEAgLTEyMTAsNiArMTIxMCw4IEBAIE1hbi1zdGFydC1jYWxsaW5nCiAgICAg KHNldGVudiAiTUFOX0tFRVBfRk9STUFUVElORyIgIjEiKQogICAgICxAYm9keSkpCiAKKyhk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i0JCQkgICAgICAgICAgICAgICAgICAoTWFuLXBhZ2UtZnJvbS1hcmd1bWVudHMgTWFuLWFy Z3VtZW50cykpKQotCQkgIChzZXRxIG1lc3NhZ2UgKGZvcm1hdCAiJXMgbWFuIHBhZ2UgY2xlYW5l ZCB1cCIKLQkJCSAgICAgICAgICAgICAgICAoTWFuLXBhZ2UtZnJvbS1hcmd1bWVudHMgTWFuLWFy Z3VtZW50cykpKSkKKyAgICAgICAgICAgICAgICAobGV0ICgoZWxhcHNlZC10aW1lCisgICAgICAg ICAgICAgICAgICAgICAgIChmb3JtYXQtdGltZS1zdHJpbmcKKyAgICAgICAgICAgICAgICAgICAg ICAgICIgW2luICVzLiUzTiBzZWNvbmRzXSIKKyAgICAgICAgICAgICAgICAgICAgICAgICh0aW1l LXN1YnRyYWN0IChjdXJyZW50LXRpbWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBtYW4tLWJhY2tncm91bmQtdGltZS1zdGFydCkpKSkKKwkJICAoc2V0cSBtZXNzYWdl CisgICAgICAgICAgICAgICAgICAgICAgICAoaWYgTWFuLWZvbnRpZnktbWFucGFnZS1mbGFnCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZvcm1hdCAiJXMgbWFuIHBhZ2UgZm9ybWF0dGVk JXMiCisJCQkgICAgICAgICAgICAoTWFuLXBhZ2UtZnJvbS1hcmd1bWVudHMgTWFuLWFyZ3VtZW50 cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsYXBzZWQtdGltZSkKKyAg ICAgICAgICAgICAgICAgICAgICAgICAgKGZvcm1hdCAiJXMgbWFuIHBhZ2UgY2xlYW5lZCB1cCVz IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChNYW4tcGFnZS1mcm9tLWFyZ3Vt ZW50cyBNYW4tYXJndW1lbnRzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVs YXBzZWQtdGltZSkpKSkKIAkJKHVubGVzcyAoYW5kIChwcm9jZXNzcCBwcm9jZXNzKQogCQkJICAg ICAobm90IChlcSAocHJvY2Vzcy1zdGF0dXMgcHJvY2VzcykgJ2V4aXQpKSkKIAkJICAoc2V0cSBt b2RlLWxpbmUtcHJvY2VzcyBuaWwpKQotLSAKMi40Ny4xCgo= --00000000000087444c062adcf371--