Subject: Re: bug#44529: [PATCH] Convert apropos-internal from C to Lisp

From: Stefan Kangas <[email-masked]>
Date: Tue, 24 Nov 2020 17:57:27 -0800

Eli Zaretskii <[email-masked]> writes:

>> From: Stefan Kangas <[email-masked]>
>> Date: Sun, 15 Nov 2020 17:07:14 -0800
>> Cc: [email-masked]
>>
>> The attached patch moves it to subr.el instead, as requested.
>
> Thanks.
>
>> This runs insignificantly faster in C, and is already fast enough on
>> reasonably modern hardware.  We might as well lift it to Lisp.
>> This benchmark can be used to verify:
>>
>>   (benchmark-run 10 (apropos-command "test"))
>>   => (0.12032415399999999 2 0.014772391999999995) ; C
>>   => (0.13513192100000002 2 0.017216643000000004) ; Lisp
>
> Btw, did you try with less trivial strings?  E.g., what happens if you
> replace "test" with "set" or "file"?

(Sorry for the late reply.)

I see results consistent with the previously reported 10 % difference,
or even slightly better than that:

(benchmark-run 10 (apropos-command "file"))
=> (0.6285004230000001 26 0.176056903)  ; C
=> (0.667433809 26 0.19296271500000006) ; Lisp

(/ 0.667433809 0.6285004230000001) => 1.0619

(benchmark-run 10 (apropos-command "set"))
=> (0.463329467 19 0.12921543499999996) ; C
=> (0.486383881 19 0.13347332099999998) ; Lisp

(/ 0.486383881 0.463329467) => 1.0497