ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2.02k stars 581 forks source link

Quick proof-of-concept that strips unnecessary deserialization calls #3138

Open chrisdennis opened 1 year ago

chrisdennis commented 1 year ago

This is a draft PR of a proof-of-concept that eliminates value deserialization from the removeAll call (and maybe some other things). There are two things that make this only a PoC:

  1. The code is ugly and could do with a bunch of cleanup/rationalization.
  2. I made no attempt to confirm that any "moved" deserialization happens safely when deserializing data pulled from offheap/disk. If we delay these deserializations too much then we may pull them outside of the relevant lock scope without taking defensive copies of the data. This could (or more likely would) lead to corruption under heavy multi-threaded access that may not be detected by the tests.

Before this is merged someone needs to go over this code to assess its safety on these dimensions (and cleanup up the general dogs dinner I left behind during my hacking).