[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CC Mode -> Tree sitter challenge
From: |
Theodor Thornhill |
Subject: |
Re: CC Mode -> Tree sitter challenge |
Date: |
Sat, 05 Nov 2022 15:37:58 +0100 |
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
- Re: CC Mode -> Tree sitter challenge, (continued)
- Re: CC Mode -> Tree sitter challenge, Eli Zaretskii, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Eli Zaretskii, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/05
- Re: CC Mode -> Tree sitter challenge,
Theodor Thornhill <=
- Re: CC Mode -> Tree sitter challenge, Eli Zaretskii, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Eli Zaretskii, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Yuan Fu, 2022/11/05
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/06
- Re: CC Mode -> Tree sitter challenge, Yuan Fu, 2022/11/06
- Re: CC Mode -> Tree sitter challenge, Theodor Thornhill, 2022/11/07
Re: CC Mode -> Tree sitter challenge, Stefan Monnier, 2022/11/05