perf: implement filter query caching #456
Merged
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.
gives
$ deno bench src/perf.ts cpu: Intel(R) Core(TM) i5-4200M CPU @ 2.50GHz runtime: deno 1.34.3 (x86_64-unknown-linux-gnu) file:https:///home/steffen/git/grammy/src/perf.ts benchmark time (avg) (min … max) p75 p99 p995 ------------------------------------------------- ----------------------------- no-cache 15.11 µs/iter (9.97 µs … 10.99 ms) 10.61 µs 39.51 µs 93.39 µs cache 234.86 ns/iter (181.11 ns … 794.87 ns) 227.01 ns 490.52 ns 497.15 ns summary no-cache 64.33x slower than cache
Closes #447.