sm
/
cache
1
0
Fork 0
Commit Graph

7 Commits

Author SHA1 Message Date
Peng Gao 884405c431 Add namespace for Item and inline janitor
Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2016-09-01 14:03:22 +08:00
Peng Gao ebc1ab826e Add decrement and increment for numberic types
Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2016-08-29 18:58:22 +08:00
Peng Gao 987311e3b4 Refactor code
1.  Add benchmark performance in README.md
2.  Use an Attr as argument for New to initiate a cache, in this
    way, more default settings can be supported.
3.  Add fast way for delete method, if no onEvicted callback
    function set.
4.  Use bool to indicate k existence in Get method to avoid
    pointer escape (which leads to memory allocation on heap),
    reference link below to get detail information.
    https://groups.google.com/forum/#!topic/golang-nuts/1WCWAtOsyDU

Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2016-08-27 19:42:15 +08:00
Peng Gao 4606d7097e cachemap: modify go-cache by using certain type
Temporaliy use int as ValueType to pass the test.

Signed-off-by: Peng Gao <peng.gao.dut@gmail.com>
2016-08-11 11:58:16 +08:00
Patrick Mylund Nielsen 901b2413ee Improve cache locality by removing Item-related pointers 2015-11-28 14:47:46 -05:00
Patrick Mylund Nielsen 03284ca422 Replace sharded hash function/misc mods 2014-12-22 10:37:59 -05:00
Patrick Mylund Nielsen ffd0b9e3ec Move the unexportedShardedCache to sharded.go 2014-12-22 00:24:49 -05:00