From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill Newsgroups: gmane.emacs.devel Subject: Re: CC Mode -> Tree sitter challenge Date: Sat, 05 Nov 2022 15:37:58 +0100 Message-ID: <87eduhxy9l.fsf@thornhill.no> References: <87v8nu1mt1.fsf@thornhill.no> <83eduh4vcf.fsf@gnu.org> <87mt951r69.fsf@thornhill.no> <83tu3d34u7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32190"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, casouri@gmail.com, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 05 15:38:42 2022 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 1orKJj-00080z-I8 for ged-emacs-devel@m.gmane-mx.org; Sat, 05 Nov 2022 15:38:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1orKJI-0007QF-Pb; Sat, 05 Nov 2022 10:38:12 -0400 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 1orKJC-0007Op-KQ for emacs-devel@gnu.org; Sat, 05 Nov 2022 10:38:07 -0400 Original-Received: from out0.migadu.com ([2001:41d0:2:267::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orKJ9-0002md-TL; Sat, 05 Nov 2022 10:38:05 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1667659080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CWjhKCLjbXM8uPLGhB2wX1dpt/X1ehjrtn4rIwL0IcQ=; b=N5szIEitVX3aLQQsmLaOoBWdmD6erjGqmgddeJCrgJ79jaXlIU19kwBVqu8rwHl2n7j7cL qn6EkmP3TVMDnAGFcSxIvaOFhFzi30LHT5K3t9ltOZvs8465pMtBtMfPKl1IFNlQ5PdLle QBmwU9FSQs5v2r18/wS0aOoiTTuW0qC2qL8Dvs5pCbQpxIQgtikGvF6reHNTL3y8S39qju ms9r/q3IIvSKgVht6t1iJKdUUZF8mlkzgSMyFPBP6cZOn5oGIdRQx3MJpfEV7IZFNlWEzT THAp8MJuEJysiPtFRky/dqzw1pmXNfrRCympQJ5kqBN6QrjThTq/6DWNx/vZVg== In-Reply-To: <83tu3d34u7.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=theo@thornhill.no; helo=out0.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299206 Archived-At: Hi again, Eli > Only in the "go-to-EOB" one, it looks like? in the others it is 3 > times faster on the average, or what did I miss? > > How about benchmarking indentation? E.g., how long does it take to > re-indent a large enough function when you add, say, 'if {' at the > beginning and '}' at the end? I took the function 'note_mouse_highlight' from xdisp.c, pushed all lines to column 0 and ran: Keep in mind that the indentation result is not 100% identical, but I doubt that will change anything. I'll benchmark everything again when we're satisfied with the behavior. This is only 2 evenings worth of hacking. (defun xdisp-indent-benchmark (mode) (benchmark-run 10 (progn (with-current-buffer (find-file "~/src/tree-sitter-modes/xdispfun.c") (funcall mode) (mark-whole-buffer) (indent-for-tab-command) (undo)) (kill-buffer "xdispfun.c")))) ;; C-MODE ;; xdisp-indent-benchmark ;; 1: (14.323358754000001 898 7.6331590500000015) ;; 2: (14.027956779 900 7.438876509) ;; 3: (13.631917978 904 7.006082581) ;; C-TS-MODE ;; xdisp-indent-benchmark ;; 1: (9.498073303 54 0.5114733610000002) ;; 2: (9.538100720000001 53 0.5083722219999984) ;; 3: (9.554900124000001 54 0.5174992560000007) -- Theo