fastify / point-of-view

Template rendering plugin for Fastify
MIT License
341 stars 86 forks source link

refactor: encapsulate cache as decorator #416

Closed mweberxyz closed 7 months ago

mweberxyz commented 7 months ago

In preparation for potentially migrating from hashlru to toad-cache -- encapsulate the lru as a decorator.

This will:

Benchmarks

Benchmark Node 18 PR Node 18 Base Node 20 PR Node 20 Base Node 21 PR Node 21 Base
express.js 8351 8231 8815 8591 8439 8447
fastify.js 42975 41247 43391 42687 42271 42463
fastify-art.js 9511 9431 10487 11567 9287 9271
fastify-dot.js 47199 46367 47615 46751 47839 46975
fastify-eta.js 27199 27007 30095 29327 37695 35327
fastify-pug.js 45183 45759 46367 44735 46719 46559
fastify-twig.js 30175 35423 38911 38335 40831 39167
fastify-liquid.js 7531 6323 7663 7667 7803 7711
fastify-mustache.js 31855 31503 34079 35423 33887 33951
fastify-nunjucks.js 41599 41631 42655 43167 43295 42463
fastify-ejs-async.js 35039 35647 43263 44095 45247 43327
fastify-ejs-minify.js 11855 12567 14463 15383 13823 14407
fastify-handlebars.js 25231 25647 31055 31727 26495 27679
fastify-ejs-local-layout.js 26831 26159 31487 31583 31039 31167
fastify-ejs-global-layout.js 34527 32479 34975 40543 40159 41375

Checklist

mweberxyz commented 7 months ago

Merge conflicts resolved.