From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Sat, 12 Jun 2021 01:25:35 +0200 Message-ID: <20210611232535.b4dyu3a2yxvdixys@Ergus> References: <83im2lbqmv.fsf@gnu.org> <179f6e4fa40.2816.cc5b3318d7e9908e2c46732289705cb0@dancol.org> <83fsxpbpn9.fsf@gnu.org> <83k0n09tkp.fsf@gnu.org> <837dj09p0e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15349"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , dancol@dancol.org, acm@muc.de, rudalics@gmx.at, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 12 01:26:46 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lrqY1-0003ok-RQ for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Jun 2021 01:26:45 +0200 Original-Received: from localhost ([::1]:53770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrqY0-0003CQ-J4 for ged-emacs-devel@m.gmane-mx.org; Fri, 11 Jun 2021 19:26:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrqX8-00026Y-H3 for emacs-devel@gnu.org; Fri, 11 Jun 2021 19:25:50 -0400 Original-Received: from sonic308-3.consmr.mail.bf2.yahoo.com ([74.6.130.42]:39600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrqX1-00019N-Jw for emacs-devel@gnu.org; Fri, 11 Jun 2021 19:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1623453942; bh=BXA1XdbLjbq9+9GxjI5eFR3HYvNSFetlL9Lr3Fh9DMg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=MMjgHi7wgFFCihFuRP2K+y2tz+dsSZZpZv4rzMlBTdK2NaMap5/R2G7XMVBKqvWywoV45+tHAU06BqqlY6Tf0Sq0N2+NNcbOy6yvXy1Q1ZOBWEtLY4GEzTt9GAHwVRu8tFdCtBeJPHUxAjfWbw1we8alm2j0vGqHpmwcIaQedcD05Z+dvEkVhIetJj7EpvoJq3rc2C9hvM4Znx0LnDUQKBvq+d+Ut0y5ks8Q1bOFrRdFlW4RpiPCac15XauvKKIgnO5eT32x/jDSWCYx8gHfIpC68Foi4CN8W2B55BvWfG4JgxF2qBJ58AM5LHgAQeUsxbBTrFb86A1P19pq3xo74g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1623453942; bh=iR7pMkVhgpZWeTGh6FVK4b/1RpKhS6A/U4wHetA6HuQ=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=klVDJ3LDdrMvkdvspXFcDyM0OvhKL4POGblMlFExGPj7Ez0Xnh4CMGrfgvg91p8jkUK4L015Vhaxxal5J39XWQBQ27+IMR5073+3P1ewdjdO6zmKq4r70hmG7ZAQkLRyXxs9y2USQJT5vHUVJvnsu60iWuy3vt71JMhbcV2EgUDRuF02Z1HW2YEzszkmIPPcmBt8WnQIaY5nPiswbXBPGnaE+2nv3U3p2fGpLvZ4+goqyNl36SNsvl0mNq3xnUd5Q6DDLKNfeeri3cyC1jLrtDp0TkA3APvAL+STQ9ljmMXZr6wo+VtSnVXjQZILhc22K6b/MOjwbEwg6sn2593kZg== X-YMail-OSG: kpIFhZYVM1m2pPWc2ZOQ7ijZY27rFTN4v8_NU4W8JNxGNSDYOKO1.koQMF18SsE qi8EZ4cV60zZBBMMpHTkCEu2tGOBWEs0hulJJ3diy2J_9bUTw_u9IrF36EDvU3NrCt9h0sQXKcMh LzinK6a9wl47l6bFydJgk6QGomi5qNuFxx02NnyhYHaPFYqJ7d3J2WQjEAy8jzuudyMPkFjR19Wp iYQEmwMIM52i79x6T4XG1Sw29FpzWXd741u3r5NKQ4WeulGJbOspjEjMhpHnPubPu1VmTbXDbhsj pwl_fKnCPsNeS6ht5EI5TJ2AIlt_2P_9W1BYuUmxqElMv17Jd42aJ.l9gO7botEhPlNpkW0IPQas a7C5b1r2pP1SMpTV1QlNZfcQn9J06ydYpIDdeXC2gF2oY7Mv6KW1VEH6nAFf7Pocr.atJKIBjl65 jHD8qhXI6iBQNHwfDl3C8bMNbBkNhrxakBNvP4t5BxivyQmAR0zC3g4kxe6GZMdEJKmUog_KTfg. TD.CgDZEpcPrkCfBUcx9H_bPkKZxiD.c4w7OszR945FfbNjd6PCFK5bUQjNeUm2ADmxgyr.MWA4Q eHV8l3I44CjmJWd1MUYIrqQVCGTeDI76aKB_9hI7Dp4noHg_d1VMcM55ooCZBe1xQldeylFXKrl2 PDi0bDuO24ylqrLEoQa7sEmfdyqdYeQOOOinhZgMFwcJpMSRmttlrKTxEA6WCw_3wGfdS7cHYjzu j3Yy.Xp3cVSApyrv9QcX79fLPIOP9Spoe.R6glJ0VJc8pBAqE.Q3mEjYGJ8fq3zQcs2KBbS70PbT lyXLKn7nmnRIMwHXq5TJ.6ntG2pj6OfydYzXgpOG.Z X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.bf2.yahoo.com with HTTP; Fri, 11 Jun 2021 23:25:42 +0000 Original-Received: by kubenode538.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 690fa89d580bee51398442430ff2a41b; Fri, 11 Jun 2021 23:25:38 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.18368 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.130.42; envelope-from=spacibba@aol.com; helo=sonic308-3.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270732 Archived-At: Going a bit more into this. And reconsidering tree-sitter. As there is already a tree-sitter module package with some interesting functionalities. (I know Eli didn't like some details in it's implementation) But maybe it is a good time to try to disable the cc-mode font-locking (I don't actually know if it is possible to do that), and repeat the scrolling benchmark only with the tree-sitter-mode and tree-sitter-hl-mode enabled? Just to see how it compares and how much of that approach is useful? On Fri, Jun 11, 2021 at 03:57:10PM -0400, Stefan Monnier wrote: >> Will Emacs 27.2 do? If you must see results from an optimized build >> of Emacs 28, I'll have to build one first. > >As mentioned, mine was not an optimized build, on the contrary. > >>> FWIW, I ran this same test with `sm-c-mode` (which should handle `xdisp.c` >>> about as well as CC-mode, but solves an easier problem since it doesn't >>> try to handle as much of C as CC-mode does (e.g. no support for K&R, no >>> highlighting of types), nor does it try to handle C++, Java, ...), and >>> most of the times for it are between 0.02 and 0.04. >> >> That is much better, but still too slow, IMO. Think: it's the time >> that it takes us to fontify a single windowful, only a couple of >> dozens of lines. Why does it take so long? > >For comparison, here it is for lisp/subr.el: it seems actually slightly >slower than what I for with xdisp.c when using sm-c-mode. > > > Stefan > > >0.075539393 >0.030856317 >0.040824289 >0.029961978 >0.012222597 >0.020277377 >0.08354889 >0.027791121 >0.040834603 >0.029304419 >0.040401518 >0.042230931 >0.041249748 >0.041759172 >0.022928028 >0.088205301 >0.01791448 >0.039915906 >0.041701691 >0.036885006 >0.037948645 >0.039082061 >0.03723824 >0.090796121 >0.021685216 >0.040341389 >0.041098352 >0.012256459 >0.038770756 >0.047087185 >0.036423884 >0.04461722 >0.082821279 >0.02936458 >0.038498799 >0.029450549 >0.039748644 >0.037981817 >0.041704413 >0.03614839 >0.040829019 >0.03792122 >0.088297379 >0.031529965 >0.038930449 >0.035313203 >0.040872462 >0.040254486 >0.043807937 >0.037344524 >0.041937701 >0.086986891 >0.02128011 >0.038679053 >0.037372497 >0.042372958 >0.045191831 >0.026552158 >0.038718167 >0.040198771 >0.086453442 >0.020748667 >0.036524354 >0.038769191 >0.036234863 >0.0399449 >0.040732675 >0.039041865 >0.037608296 >0.078606241 >0.022010691 >0.03774944 >0.028604627 >0.040171841 >0.039866605 >0.035715879 >0.041613829 >0.035701447 >0.037601563 >0.085249827 >0.018101252 >0.041692999 >0.033016519 >0.037679106 >0.039894138 >0.036513263 >0.04271547 >0.038203434 >0.089595139 >0.022256597 >0.040981642 >0.037780354 >0.036986214 >0.033088927 >0.03626288 >0.037085366 >0.023201762 >0.088236647 >0.019961394 >0.033811429 >0.040647559 >0.034390619 >0.039764122 >0.022225068 >0.026550511 >0.037590894 >0.085617853 >0.022528 >0.040158828 >0.039360065 >0.015918947 >let: End of buffer > >