groupon / node-cached

A simple caching library for node.js, inspired by the Play cache API
BSD 3-Clause "New" or "Revised" License
94 stars 15 forks source link

Order of magnitude increase in cache set time with values of certain size #14

Closed seifertd closed 9 years ago

seifertd commented 9 years ago

See Gist: https://gist.github.com/seifertd/8ef466901facae318e20

node-memcached: version 2.1.0 node-cached: version 4.0.0

Cache a string of size ranging from 515,000 bytes to 525,000 bytes in increments of 100 bytes. Using cached, store time is longer than using plain vanilla memcached (to be expected), but when the object being cached has a size >= 516,000 bytes and size <= 524200, the store time is an order of magnitude higher than the store time of objects outsize that size range.

The plain vanilla memcached library does not suffer from this problem.

Possibly related to: https://github.com/3rd-Eden/node-memcached/pull/205

ghost commented 9 years ago

Hey Doug,

Thanks for finding the issue. Try this branch and let me know whether it fixes the problem.