smartparens icon indicating copy to clipboard operation
smartparens copied to clipboard

Memoize sp--strict-regexp-quote

Open aaronjensen opened this issue 8 years ago • 1 comments

One potential improvement to #595 would be to memoize sp--strict-regexp-quote. According a reverse rendered profile it's on the higher end of cpu samples. It's a pure function with a limited input set, so it's ripe for memorization. I'd be happy to offer a pull, but I don't know how you'd like to memoize it, if you'd like to pull in a package like https://github.com/skeeto/emacs-memoize or just roll your own.

+ sp--looking-back                                                269  16%
+ sp--strict-regexp-quote                                         156   9%
+ syntax-ppss                                                     151   9%
+ sp--looking-back-p                                              111   6%
  flyspell-post-command-hook                                       76   4%
+ get-frame-persp                                                  71   4%
+ sp-delete-pair                                                   55   3%
+ spaceline-ml-main                                                53   3%
+ sp--looking-at                                                   48   2%
+ sit-for                                                          39   2%
+ #<compiled 0x40ebed8b>                                           38   2%
+ intern                                                           30   1%
+ timer--time-less-p                                               30   1%
+ pl/create-or-get-cache                                           24   1%

aaronjensen avatar May 16 '16 06:05 aaronjensen

Anything by skeeto is fine :) Go ahead, just don't forget to put it in Cask and then run cask pkg-file to regenerate the dependency tracking file.

Fuco1 avatar May 16 '16 06:05 Fuco1