From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Processing speed in large C++ raw strings. Date: Fri, 26 Apr 2019 04:25:05 +0300 Message-ID: <49b7f6d3-a590-c4f6-f943-40e65cdfa278@yandex.ru> References: <20190425183615.GB19807@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="70802"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 26 03:25:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJpc6-000IIA-Pb for ged-emacs-devel@m.gmane.org; Fri, 26 Apr 2019 03:25:18 +0200 Original-Received: from localhost ([127.0.0.1]:37579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJpc5-00054x-Mn for ged-emacs-devel@m.gmane.org; Thu, 25 Apr 2019 21:25:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJpbz-00052s-Dx for emacs-devel@gnu.org; Thu, 25 Apr 2019 21:25:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJpby-00061p-EC for emacs-devel@gnu.org; Thu, 25 Apr 2019 21:25:11 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:56246) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJpby-0005yC-5Y for emacs-devel@gnu.org; Thu, 25 Apr 2019 21:25:10 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id o25so1577386wmf.5 for ; Thu, 25 Apr 2019 18:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cg1Otg6U7/cURoii/ngt1SI0I5UrMtFhLHasB1sZ3DU=; b=n76aTG3CjTSDdxVBwTPvOcG0IOJJt+EG9Fv/r8ajSR7CRira6msZKr47l7xKrnFkGT 6YBcVk7gp3raFEG/vgWBTk3xjN7avJCDVXz+xNlh2n8cYJJoNb2rPdp9sMMUfAC/TJ7/ NE7wN7+wCPSqqIZQwam+IpCpVqgo1XzAdQ8Oqo/owf6ss1LcD1lbOYCrlOGsWPGKtrl/ 8rLrzLoqcuJ8xnAer2vsGx1+1y5CHFRqlHqu6G8sclmPvO1ZI73w1zuz0yc1ZxfFBcAk ap/VqwP+W0ZFc9dgjIJ3D4d83lt2SZP9E/XtmEgX/KZYn5QuIjFEhr9mmdtGv8n/DTHC ZcGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cg1Otg6U7/cURoii/ngt1SI0I5UrMtFhLHasB1sZ3DU=; b=IiYSixiRbPuy8Zm3Ky8RxuymLO0k4jhRA1kuL6Lf32cHeVRBHwqj7sv+YBWuygFD1F uYzmRhkmxA1W5qcA3pDbifSxCmQMmzsCcCKLY9meb7efT0z0SU1nKpMbADPV0hLSsI3B ntdAxuGQGtsiqd76Y806HviSLLBtYQkeR2hgnnQX43bcrUb8TpZhPMzm/zN18OycEsPA 4alx2AbJNjgenWyYZ+in1eGTwOvyAZO2+dwHCoF9uIpsTsBlfjnlvPJZkk+N0WEkMO4M Kq1U8GjZUKuTA+UnL1g6eqwqIAiEeP/N9X19/6WRAMZmMVsuZZDdoaGY3Fl0i0vSGAl/ NCvA== X-Gm-Message-State: APjAAAVvZxlZ3uNqtpC2wte7P+fhdDTJi/BbhJoC8xp2KNSGXo0oe8M0 berZls1jWBVGPiDTfS3G9SYodonD X-Google-Smtp-Source: APXvYqw9vhL5cmvbWQqj9RA/X21VqdC75CyPAHldKuHjdRicZMthgIVh3wXW4q1YT4XManFC25PV5g== X-Received: by 2002:a1c:6502:: with SMTP id z2mr5318898wmb.119.1556241908002; Thu, 25 Apr 2019 18:25:08 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.23]) by smtp.googlemail.com with ESMTPSA id n6sm28799643wmn.48.2019.04.25.18.25.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 18:25:07 -0700 (PDT) In-Reply-To: <20190425183615.GB19807@ACM> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235944 Archived-At: Hi Alan, On 25.04.2019 21:36, Alan Mackenzie wrote: > Some while ago, you were complaining, justifiably, about the > sluggishness when typing characters into very long C++ raw strings. To > demonstrate this, you put xdisp.c into C++ mode, and put a raw string > round nearly the entire buffer. It was an argument in a discussion, not exactly a bug report (I don't write C++), but it's laudable progress, of course. > Last week, it was taking over 2 seconds to process a single > self-insert-command into this string, and my machine is not slow. > > I have now optimized CC Mode, such that each such self-insert-command > now takes around 0.07s-0.1s. I used two strategies for this: (i) breaking out > of (expensive) fontification routines early, when the region being > fontified is nothing but a string; (ii) Not fontifying the entire raw > string for a change to only a small part of it. Pulled the latest changes, rebuilt Emacs and tried this. The result still feels fairly sluggish at times (the pauses seem longer than the timings you mention, especially when I type or delete the relevant double-quote characters), but it should definitely make editing such literals possible and even bearable. Here's a seemingly related discussion you might be interested in: https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00715.html