From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59738: c-ts-mode is slow with large buffers. Date: Sat, 3 Dec 2022 02:37:08 -0800 Message-ID: <610A4A5E-4559-41F7-B94D-14F6D4C96887@ucsd.edu> References: Reply-To: Yuan Fu Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59738@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 03 21:33:53 2022 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 1p1ZCp-0007fp-Bo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Dec 2022 21:33:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1ZC8-0000AF-Hk; Sat, 03 Dec 2022 15:33: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 1p1ZC3-00006Y-16 for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1ZC2-0002Op-Ij for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1ZC2-0000wd-Dh for bug-gnu-emacs@gnu.org; Sat, 03 Dec 2022 15:33:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Dec 2022 20:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59738 X-GNU-PR-Package: emacs Original-Received: via spool by 59738-submit@debbugs.gnu.org id=B59738.16700995763605 (code B ref 59738); Sat, 03 Dec 2022 20:33:02 +0000 Original-Received: (at 59738) by debbugs.gnu.org; 3 Dec 2022 20:32:56 +0000 Original-Received: from localhost ([127.0.0.1]:53190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1ZBv-0000vz-Hr for submit@debbugs.gnu.org; Sat, 03 Dec 2022 15:32:56 -0500 Original-Received: from mx0b-0016e101.pphosted.com ([148.163.141.31]:57370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1PtS-0007mG-Fb for 59738@debbugs.gnu.org; Sat, 03 Dec 2022 05:37:17 -0500 Original-Received: from pps.filterd (m0151360.ppops.net [127.0.0.1]) by mx0b-0016e101.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B3AbDVb005886 for <59738@debbugs.gnu.org>; Sat, 3 Dec 2022 02:37:13 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; h=from : content-type : content-transfer-encoding : mime-version : subject : message-id : date : cc : to; s=campus; bh=mSgkzoXGWK5JRcJTJbGKKbvBGIcTPzcHW3VSDtZKlqM=; b=CeG1hXVjudON1Ssq7KgZR5kI54cv9dY90TAhyrltk1Faa/ocUNVOaieSPSL1xzKvo2yx pKW0ARt5xKOJkRZ6ITHh9JdPT2qirZwNG57VawdC0zkisWjWz5ptAUIexK9lr8g0Fqh5 jjTw3OVs5rQkDmiNZ22qqH/DfaJiL95YV1VmV6bFNSkxOJlDTEmQ0uX1DqliuSe8AZ5W nSc2xO2cD7v0Pk7EwR5fV6IR5z2oK5oOixar5MBDVQGiTwZUb4XEYw/4shaZxjrXu+w3 hJMbNhmALaTJazOAYm8tBTI7rxjJa92zO/AsvjrS+U3+G+pPJNdUa+pdGiNDtONLYFoy +Q== Original-Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0b-0016e101.pphosted.com (PPS) with ESMTPS id 3m7tmc40ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for <59738@debbugs.gnu.org>; Sat, 03 Dec 2022 02:37:13 -0800 Original-Received: by mail-pj1-f72.google.com with SMTP id u10-20020a17090a400a00b00215deac75b4so7318389pjc.3 for <59738@debbugs.gnu.org>; Sat, 03 Dec 2022 02:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucsd.edu; s=google; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=mSgkzoXGWK5JRcJTJbGKKbvBGIcTPzcHW3VSDtZKlqM=; b=katGHbbLwlE36Lk2X+LTbeR2fPNGswZy/+29sDTsnVs8QTu36sTGIVYq2v0abpJsUK LgjOxbBDEPaJ5z+oZisiRrsyTAIz4NYcn8GdC1g1ME0BGDypeJzASIyJd5gFa24BWwR/ NTuGaTzxL6pjDfOc029PaIBxuqW5xGmo5zIjI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mSgkzoXGWK5JRcJTJbGKKbvBGIcTPzcHW3VSDtZKlqM=; b=di7qAL/kvyY7oUs881/vWC1l26VgUajHr6RRGaY1SEdqMnahuHA6kuGdQlvRMWYQwa A0HO2SuIh7ui1hUGAc2gpOdKVuYc/tdSLM6mbRCHiRUM4cbFnUZ6Qzmswg4HX9izDhz/ nL9eVan6L/EEq3jqsKDqVuNbArikVDM1A6ef837/TznhnUA3hHi36e7sILahGm7hMga5 fCoenbP54NP94IPcvZPlaxoa/ct6dq7BmYIohIe9LaYmLJFBpMr9ogKXJCNt+iL0PKbp BDbQd3HIjiF5ReqXAWdTh+NGVQKGivGPD/uUVOpiDLqJQuN/SaucMSka70nTl+pbdwlM VQHg== X-Gm-Message-State: ANoB5pn0oFHv5tbbLblxSowOzdiArRmPKR0U4zGjSW0cnXe+r6CWlWU7 mn/FiMhLsrQm8QNWcR9SWiCD9jFJjTIoT7b35TqOLVtx+AWmXu3wWtFyYycCB8u/2kdC0hgIlDt yQX3IiW4VE582RQ== X-Received: by 2002:a17:90a:6d62:b0:219:4ee5:ccc9 with SMTP id z89-20020a17090a6d6200b002194ee5ccc9mr23936076pjj.63.1670063832131; Sat, 03 Dec 2022 02:37:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GBMSd6BFwocF+FgifU8ZmgRfxRTX+vWKNSoFu6YOBSkuxqHs4xIQp8g7FZ1UtGADB3HV5+Q== X-Received: by 2002:a17:90a:6d62:b0:219:4ee5:ccc9 with SMTP id z89-20020a17090a6d6200b002194ee5ccc9mr23936060pjj.63.1670063831780; Sat, 03 Dec 2022 02:37:11 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id l15-20020a170903244f00b0017fe9b038fdsm7156081pls.14.2022.12.03.02.37.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2022 02:37:11 -0800 (PST) X-Mailer: Apple Mail (2.3696.120.41.1.1) X-campus_gsuite: gsuite_33445511 X-Proofpoint-ORIG-GUID: w0lb46rSKynY0gvrE50bsLTFAQM-FTbD X-Proofpoint-GUID: w0lb46rSKynY0gvrE50bsLTFAQM-FTbD pp_allow_relay: proofpoint_allowed X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-03_05,2022-12-01_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1011 impostorscore=0 mlxlogscore=531 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212030092 X-Mailman-Approved-At: Sat, 03 Dec 2022 15:32:51 -0500 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:249878 Archived-At: Alan Mackenzie writes: > Hello, Emacs. > > In an up to date (2022-11-30) master started as $ emacs --no-desktop: > > The file = .../drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_sh_mask.h > in the Linux source tree is 6.8 MB big, consisting of a large number = of > #defines and comments, but nothing else. > > To scroll through it in c-ts-mode takes a little over 26 minutes on my > system. By comparison, in C Mode it takes 31 seconds. There would > appear to be a need for some optimisation in c-ts-mode, here. > > > The file > = https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet= -rrc.c > (see bug #45248) (10 MB) takes 578 seconds to scroll in c-ts-mode. It > scrolls through the first 83% of the buffer rapidly, then chokes on a = big > brace block initialisation. Also, the font-locking fails part way > through this brace block (without any apparent speed up). > > For comparison, the scrolling takes 30 seconds in C Mode. There seems = to > be a need for optimisation of c-ts-mode in this case, too. > > > For completeness, I used M-: (time-scroll) in the following for the > timings: > > (defmacro time-it (&rest forms) > "Time the running of a sequence of forms using `float-time'. > Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"." > `(let ((start (float-time))) > ,@forms > (- (float-time) start))) > > (defun time-scroll (&optional arg) > (interactive "P") > (message "%s" > (time-it > (condition-case nil > (while t > (if arg (scroll-down) (scroll-up)) > (sit-for 0)) > (error nil))))) Thanks for the report! I=E2=80=99m a bit overwelmed by all the open bug = reports right now, but I=E2=80=99ll be sure to investigate it as soon as I=E2=80=99= m able. Yuan