mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for small lists (under 250 items), which is exactly how I've been using them. The only caveat is alist-get's signature is different on Emacs 25, thus a polyfill is necessary in core-lib.
This commit is contained in:
@ -78,10 +78,10 @@ BODY will be run when this dispatcher is called."
|
||||
(append
|
||||
(when aliases
|
||||
`((dolist (alias ',aliases)
|
||||
(map-put doom--dispatch-alias-alist alias ',cmd))))
|
||||
`((map-put doom--dispatch-command-alist ',cmd
|
||||
(list :desc ,docstring
|
||||
:body (lambda (args) ,form))))))))
|
||||
(setf (alist-get alias doom--dispatch-alias-alist) ',cmd))))
|
||||
`((setf (alist-get ',cmd doom--dispatch-command-alist)
|
||||
(list :desc ,docstring
|
||||
:body (lambda (args) ,form))))))))
|
||||
|
||||
|
||||
;;
|
||||
|
Reference in New Issue
Block a user