freecache icon indicating copy to clipboard operation
freecache copied to clipboard

a small question

Open mintzhao opened this issue 9 years ago • 2 comments
trafficstars

I already know the free cache is fast than map.

but freecache store []byte in memory, and always our's data isn't []byte, so we should marshal or convert data to []byte..

so, my question is marshal time worth using freecache?

mintzhao avatar May 10 '16 13:05 mintzhao

Most of the time, marshal/unmarshal would be much more expensive than lookup. But if you have many CPU cores and access your cache concurrently, freecache may worth using.

coocood avatar May 10 '16 16:05 coocood

@coocood How about use interface{}, and use type assertion instead of marshal/unmarsh?

mqliang avatar Jun 14 '17 07:06 mqliang