emacs-devel
[Top][All Lists]
Advanced

[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:46:33 +0100


On 5 November 2022 15:34:25 CET, Stefan Monnier <monnier@iro.umontreal.ca> 
wrote:
>> We usually use something like the below:
>>
>>   (defun scroll-up-benchmark ()
>>     (interactive)
>>     (let ((oldgc gcs-done)
>>        (oldtime (float-time)))
>>       (condition-case nil (while t (scroll-up) (redisplay))
>>      (error (message "GCs: %d Elapsed time: %f seconds"
>>                      (- gcs-done oldgc) (- (float-time) oldtime))))))
>>
>>   (defun scroll-up-by-40-benchmark ()
>>     (interactive)
>>     (let ((oldgc gcs-done)
>>        (oldtime (float-time)))
>>       (condition-case nil (while t (scroll-up 40) (redisplay))
>>      (error (message "GCs: %d Elapsed time: %f seconds"
>>                      (- gcs-done oldgc) (- (float-time) oldtime))))))
>
>See also the `elisp-benchmark` package, especially its
>`benchmarks/elb-scroll.el` which shows how to do that in batch mode.
>
>We could tweak that file to define not just `elb-scroll-entry` but also
>`elb-cc-scroll-entry` to compare the time between the use of
>`elb-smie-mode` (whose purpose is not to show how it compares to
>CC-mode's C mode but rather to have a non-varying code across Emacs
>versions, so we can see the effect of other factors than the mode
>itself) and CC-mode's `c-mode` and another using your new `c-mode`.
>
>
>        Stefan
>

Thanks! I'll check it out

Theo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]