Add memoization for sp--strict-regexp-quote #605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #603
To be honest, this didn't seem to make much difference. I couldn't reproduce
sp--strict-regexp-quote
taking up a large number of samples while profiling and adding the memoization in didn't seem to help. Furthermore, the timers created by the memoize package seem to dominate the profiler without actually seeming to impact typing latency (which makes sense, I guess). If I disabled the timers by setting(setq memoize-default-timeout nil)
they didn't appear in the profile, but since that's a global setting I don't think it makes sense for us to set. It doesn't seem like there's a way with this package to say you don't a timeout for a specific function because of the(or timeout memoize-default-timeout)
.Long story short, it'd be great if someone else could measure with typometer the difference between memoizing and not. It seemed to not matter too much on my machine.
Lastly, if we were going to memoize, I don't think this is the package for it because we probably don't actually want a timeout for this specific function. Adding so many additional timers probably doesn't help anything.