convex icon indicating copy to clipboard operation
convex copied to clipboard

Cache recently used encodings in store

Open mikera opened this issue 4 years ago • 0 comments

There is a potential significant performance improvement given incoming encodings:

  • Keep a array of WeakReference<ACell> in AStore
  • Index this by some function of ABlob.toLong()
  • Use to lookup Cells already in memory if available
  • Write to this array whenever a cell is stored (can overwrite safely on collisions since this is just a cache)

This should help:

  • De-duplicate objects in memory
  • Avoid decoding encodings if we have already done this
  • Avoid hashing for repeatedly encountered encodings (e.g. incoming copies of the same orderings / blocks / transactions from multiple peers)
  • Re-use the latest refs with corresponding statuses in the target cells to avoid repeated store checks / writes

mikera avatar Aug 11 '21 06:08 mikera