From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Processing speed in large C++ raw strings. Date: Thu, 25 Apr 2019 18:36:15 +0000 Message-ID: <20190425183615.GB19807@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="236731"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 25 20:41:23 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 1hJjJ9-000zPP-Vc for ged-emacs-devel@m.gmane.org; Thu, 25 Apr 2019 20:41:20 +0200 Original-Received: from localhost ([127.0.0.1]:33707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJjJ8-0003Jo-Vm for ged-emacs-devel@m.gmane.org; Thu, 25 Apr 2019 14:41:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJjIs-00037p-N1 for emacs-devel@gnu.org; Thu, 25 Apr 2019 14:41:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJjEL-0004q3-HT for emacs-devel@gnu.org; Thu, 25 Apr 2019 14:36:22 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:52369 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1hJjEL-0004jY-6n for emacs-devel@gnu.org; Thu, 25 Apr 2019 14:36:21 -0400 Original-Received: (qmail 54927 invoked by uid 3782); 25 Apr 2019 18:36:15 -0000 Original-Received: from acm.muc.de (p4FE15E4E.dip0.t-ipconnect.de [79.225.94.78]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 25 Apr 2019 20:36:15 +0200 Original-Received: (qmail 22057 invoked by uid 1000); 25 Apr 2019 18:36:15 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 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:235933 Archived-At: Hello, Dmitry. 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. 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. -- Alan Mackenzie (Nuremberg, Germany).