]> git.eshelyaron.com Git - emacs.git/commit
Convert apropos-internal from C to Lisp (Bug#44529)
authorStefan Kangas <stefan@marxist.se>
Sat, 19 Dec 2020 18:54:46 +0000 (19:54 +0100)
committerStefan Kangas <stefan@marxist.se>
Sat, 19 Dec 2020 18:54:46 +0000 (19:54 +0100)
commit7c3d3b83358842857a0af99b89983cfa9a5512a1
tree6fd1a0e1e6952f93b262a89de044ba341e2a4cc3
parent34a73666d9559d948815a53b63dc36cc878d5aff
Convert apropos-internal from C to Lisp (Bug#44529)

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

* lisp/subr.el (apropos-internal): New defun, converted from C.
* src/keymap.c (Fapropos_internal): Remove defun.
(apropos_accum): Remove function.
(apropos_predicate, apropos_accumulate): Remove variables.
(syms_of_keymap): Remove defsubr for Fapropos_internal, and
definitions of the above variables.
* test/src/keymap-tests.el (keymap-apropos-internal)
(keymap-apropos-internal/predicate): Move tests from here...
* test/lisp/subr-tests.el (apropos-apropos-internal)
(apropos-apropos-internal/predicate): ...to here.
lisp/subr.el
src/keymap.c
test/lisp/subr-tests.el
test/src/keymap-tests.el