Message from discussion
: memoizee - Complete memoize/cache solution
Received: by 10.58.70.7 with SMTP id i7mr409847veu.2.1348083408344;
Wed, 19 Sep 2012 12:36:48 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.52.92.207 with SMTP id co15ls1185548vdb.5.gmail; Wed, 19 Sep
2012 12:36:38 -0700 (PDT)
Received: by 10.52.72.16 with SMTP id z16mr1047208vdu.15.1348083398952;
Wed, 19 Sep 2012 12:36:38 -0700 (PDT)
Date: Wed, 19 Sep 2012 12:36:38 -0700 (PDT)
From: Jeff Barczewski <jeff.barczew...@gmail.com>
To: nodejs@googlegroups.com
Message-Id: <d3469b57-5db5-4819-af2a-0d5d0e923447@googlegroups.com>
In-Reply-To: <b1cc62b3-398f-4367-b8ff-4a77463bc611@googlegroups.com>
References: <edf760ec-d6b4-41e9-969a-13eaba7f9210@googlegroups.com>
<2d5d25d4-312d-4de8-8204-083f991170bb@googlegroups.com>
<a47e6d6d-b8ed-4fbb-ba2c-51f8886376a1@googlegroups.com>
<b1cc62b3-398f-4367-b8ff-4a77463bc611@googlegroups.com>
Subject: Re: [ANN]: memoizee - Complete memoize/cache solution
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_197_5594811.1348083398607"
------=_Part_197_5594811.1348083398607
Content-Type: multipart/alternative;
boundary="----=_Part_198_12480035.1348083398608"
------=_Part_198_12480035.1348083398608
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Mariusz,
You are right, I missed the mention in the readme about building it for the
browser, but it is nice that you prepared a download bundle. Honestly I
just went right to the code first and only glanced at the README for the
API, so I ended up missing that.
Correct me if I am wrong, but isn't the max option, FIFO, so unlike a LRU
cache which keeps the most recently used objects cached, this would expire
the first one that was cached regardless of whether it was recently
used/requested or not.
One reason this is nice is that a LRU cache ends up staying loaded with the
most popular content, the random requests don't end up kicking out an
important one.
For many things, the max option would be fine, but just for completeness
(and a very popular use case), it would be great to have a LRU option.
Just my thoughts for completing out the feature set. I think your project
is great none the less.
Jeff
On Wednesday, 19 September 2012 10:47:07 UTC-5, Mariusz Nowak wrote:
>
> Jeff,
>
> It can easily be ported to browser with help of Webmake
> https://github.com/medikoo/modules-webmake (it's mentioned in
> documentation)
> Anyway to make it even easier I prepared a bundle ->
> https://github.com/medikoo/memoize/downloads ;)
>
> According to LRU option, you can achieve it with 'max' option ->
> https://github.com/medikoo/memoize#limiting-cache-size
> See also 'maxAge' and 'dispose' options. Is that what you're after?
>
>
> On Wednesday, September 19, 2012 5:17:58 PM UTC+2, Jeff Barczewski wrote:
>>
>> Mariusz,
>>
>> I took a closer look and realized that there a many dependencies (I was
>> thinking it was self contained), so not as simple to get into the browser,
>> either need to use something like AMD or build a distribution file with one
>> of the commonsjs browser build solutions.
>>
>> Jeff
>>
>>
>>
>> On Wednesday, 19 September 2012 10:14:57 UTC-5, Jeff Barczewski wrote:
>>>
>>> Mariusz,
>>>
>>> memoize looks really nice! I am going to try it out for some projects I
>>> am working on.
>>>
>>> As for suggestions:
>>>
>>> - you might consider wrapping the file in a function closure so it can
>>> be used directly in a browser
>>> - could you add a LRU option? (I know you have many other algorithms,
>>> but would be nice to have if it doesn't add too much bulk)
>>>
>>> Thanks for sharing this!
>>>
>>> All the best,
>>>
>>> Jeff
>>>
>>
------=_Part_198_12480035.1348083398608
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mariusz,<div><br></div><div>You are right, I missed the mention in the read=
me about building it for the browser, but it is nice that you prepared a do=
wnload bundle. Honestly I just went right to the code first and only glance=
d at the README for the API, so I ended up missing that.</div><div><br></di=
v><div>Correct me if I am wrong, but isn't the max option, FIFO, so unlike =
a LRU cache which keeps the most recently used objects cached, this would e=
xpire the first one that was cached regardless of whether it was recently u=
sed/requested or not. </div><div><br></div><div>One reason this is nic=
e is that a LRU cache ends up staying loaded with the most popular content,=
the random requests don't end up kicking out an important one.</div><div><=
br></div><div>For many things, the max option would be fine, but just for c=
ompleteness (and a very popular use case), it would be great to have a LRU =
option.</div><div><br></div><div>Just my thoughts for completing out the fe=
ature set. I think your project is great none the less.</div><div><br></div=
><div>Jeff </div><div><br></div><div><br></div><div><br>On Wednesday, =
19 September 2012 10:47:07 UTC-5, Mariusz Nowak wrote:<blockquote class=3D=
"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc s=
olid;padding-left: 1ex;">Jeff,<div><br></div><div>It can easily be ported t=
o browser with help of Webmake <a href=3D"https://github.com/medikoo/m=
odules-webmake" target=3D"_blank">https://github.com/<wbr>medikoo/modules-w=
ebmake</a> (it's mentioned in documentation)<div>Anyway to make it even eas=
ier I prepared a bundle -> <a href=3D"https://github.com/medikoo/memoize=
/downloads" target=3D"_blank">https://github.com/medikoo/<wbr>memoize/downl=
oads</a> ;)<br></div><div><br></div><div>According to LRU option, you can a=
chieve it with 'max' option -> <a href=3D"https://github.com/medikoo/mem=
oize#limiting-cache-size" target=3D"_blank">https://github.com/medikoo/<wbr=
>memoize#limiting-cache-size</a></div><div>See also 'maxAge' and 'dispose' =
options. Is that what you're after?</div><div><br></div><div><br></div><div=
>On Wednesday, September 19, 2012 5:17:58 PM UTC+2, Jeff Barczewski wrote:<=
blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border=
-left:1px #ccc solid;padding-left:1ex"><div>Mariusz,</div><div><br></div><d=
iv>I took a closer look and realized that there a many dependencies (I was =
thinking it was self contained), so not as simple to get into the browser, =
either need to use something like AMD or build a distribution file with one=
of the commonsjs browser build solutions.</div><div><br></div><div>Jeff</d=
iv><div><br></div><br><br>On Wednesday, 19 September 2012 10:14:57 UTC-5, J=
eff Barczewski wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;m=
argin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">Mariusz,<div>=
<br></div><div>memoize looks really nice! I am going to try it out for some=
projects I am working on.</div><div><br></div><div>As for suggestions:</di=
v><div><br></div><div> - you might consider wrapping the file in a fun=
ction closure so it can be used directly in a browser</div><div> - cou=
ld you add a LRU option? (I know you have many other algorithms, but would =
be nice to have if it doesn't add too much bulk)</div><div><br></div><div>T=
hanks for sharing this!</div><div><br></div><div>All the best,</div><div><b=
r></div><div>Jeff</div></blockquote></blockquote></div></div></blockquote><=
/div>
------=_Part_198_12480035.1348083398608--
------=_Part_197_5594811.1348083398607--