Questions tagged [memoizee]

8 questions
5
votes
3 answers

Memoizee instance method in node Class

I'm seeking an elegant way to memoize a class function using Memoizee package. Outside a class, you can go about this trivially: const memoize = require('memoizee') const myFunc = memoize(function myfunc(){ ... }) but inside a class block, this…
Selfish
  • 6,023
  • 4
  • 44
  • 63
3
votes
1 answer

Using Memoizee with node.js

I want to use Memoizee on my node.js backend, to speed up the requests. But for some reason, I can't get it to work like I want to. I have a route, that waits for the callback of another method, but no matter how long I save the result in cache, it…
Englund0110
  • 514
  • 2
  • 5
  • 23
2
votes
0 answers

Rails memoize the wrong value for current user

I've been building a small web app and have been using Michael Hartl's guide for creating accounts / authorization. Whilst testing the app amongst friends, a couple have gone on the website and found themselves to logged in as the wrong current…
1
vote
1 answer

how to cache in node js?

I am new to nodejs. I have one API which returns file in response. Currently when I get the request, I read the file every time and send it. Can we do caching in memory to speed up? I checked this package. can we use this package to speed…
user19652820
1
vote
1 answer

Using memoizee with TypeScript's classes

I would like to use memoization technique in TypeScript's classes using memoizee library. Here is some code of what have I already tried: import memoize from "memoizee" import { getModule, Module, MutationAction, VuexModule } from…
Jacek
  • 69
  • 5
0
votes
1 answer

enable_memoize and max_parallel_workers_per_gather problem or bug?

using Postgresql 15.2, I tried any kind of query that join a CTE with a table: with t as (select t.day from calendar where idtime between 20230101 and 20230224) select idcell, sum (tmean) from weather w join t on w.day = t.day group by…
0
votes
2 answers

Should function memoization always be preferred?

Recently I came upon function memoization. I have read, that it can be used to optimise calls to functions that do some heavy computing, by caching it results if function parameters didn't change. My question is, should I always use memoization…
Marek
  • 3,935
  • 10
  • 46
  • 70
0
votes
1 answer

memoizee - Cached based on arguments

I would like to memoize results of function based on provided arguments. For example: getFiles('/articles/en') getFiles('/articles/pl') This invocations should be independent and should have standalone cached results. Currently I always receive…