bicache icon indicating copy to clipboard operation
bicache copied to clipboard

performance review

Open jamiealquiza opened this issue 8 years ago • 12 comments

This is an in-memory cache; every cycle counts.

Also see: https://github.com/jamiealquiza/bicache/issues/20, https://github.com/jamiealquiza/bicache/issues/17

jamiealquiza avatar Nov 07 '16 22:11 jamiealquiza

PromoteEvict / sll.Remove has a > 500x speedup w/ 25K nodes here: https://github.com/jamiealquiza/bicache/commit/49dd2b16ea6eaccdd0389623eb127be82aeebbaa

jamiealquiza avatar Nov 11 '16 17:11 jamiealquiza

^ Had bugs, rolled back. Pending reintroduction in https://github.com/jamiealquiza/bicache/issues/7.

jamiealquiza avatar Nov 15 '16 20:11 jamiealquiza

Exchanged sll's mutex-guarded counter with an atomic CAS here https://github.com/jamiealquiza/bicache/commit/817289f3a670f15055c824d739bd99e2107f6ec5

jamiealquiza avatar Dec 06 '16 21:12 jamiealquiza

Switched the removeFromScores search algo to an unrolled linear search here https://github.com/jamiealquiza/bicache/commit/0dec79993e67ef1fa0c8edf3d648a0f9e0853f3a

jamiealquiza avatar Dec 06 '16 21:12 jamiealquiza

Sll can pre-allocate an internal nodeScoreList with specific size (e.g. the capacity of a cache implementing sll). This improved initial insert times for 100k items by ~50%. https://github.com/jamiealquiza/bicache/commit/a9e97437f45b2646e8b51521bd7ec4d1e9b708fe

jamiealquiza avatar Dec 07 '16 23:12 jamiealquiza

Sll refactor reduces instructions per op https://github.com/jamiealquiza/bicache/commit/a8ebb453c8fbd24701bfc505db8924073a150207

jamiealquiza avatar Dec 08 '16 21:12 jamiealquiza

Removed deferred mutex unlocks https://github.com/jamiealquiza/bicache/commit/52c1f3b1ad15ec9e2c36a7413dd65d870bd5fac8. Get perf seems to have improved; needs comparative testing.

jamiealquiza avatar Jan 30 '17 18:01 jamiealquiza

https://github.com/jamiealquiza/bicache/issues/22 and https://github.com/jamiealquiza/bicache/issues/11 were closed.

jamiealquiza avatar Feb 07 '17 21:02 jamiealquiza

1,500x improvement in PromoteEvict https://github.com/jamiealquiza/bicache/compare/430917024a989dd1800053acb2eb851654d8e245...5aa26f2a7d621afc6daddfa20960ca0bfee457e5

jamiealquiza avatar Feb 09 '17 23:02 jamiealquiza

Tail eviction speed up https://github.com/jamiealquiza/bicache/commit/c72347bf481c56ed65ca2910cf9aa0579c87d6e4

jamiealquiza avatar Feb 11 '17 15:02 jamiealquiza

Sll node removal avoids mem copies https://github.com/jamiealquiza/bicache/commit/ca2287df96839ceabd8282b41b5d6ca0ddd92d47

jamiealquiza avatar Feb 11 '17 15:02 jamiealquiza

Faster FNV-1 32-bit https://github.com/jamiealquiza/bicache/commit/72f882470e1ff78521f0454b9bbbd413606c5a9b

jamiealquiza avatar Feb 18 '17 15:02 jamiealquiza