GNU bug report logs -
#44529
[PATCH] Convert apropos-internal from C to Lisp
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Mon, 9 Nov 2020 10:40:01 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 44529 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Stefan Kangas <stefan <at> marxist.se>
>> Date: Sun, 15 Nov 2020 17:07:14 -0800
>> Cc: 44529 <at> debbugs.gnu.org
>>
>> 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
This bug report was last modified 4 years and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.