composablesys / collabs

Collabs library monorepo

Home Page:https://collabs.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PrimitiveCList optimizations

mweidner037 opened this issue · comments

Benchmark throughout to see which ones make a difference.

  • Use ids in single-element delete messages, instead of full loc
  • reset: leave both ends of the range unset, loop over all values without comparisons
  • For longer range deletes, find start and end indices first and then loop, instead of comparing ids each time
  • For range deletes, emit bulk delete events each time you get to a non-skipped index, instead of individual events per character
  • Use anchor deduplication in saved state, like in memory
  • When loading, build the whole tree at once as an all-black tree, in O(n) time
  • Misc TODOs in TreedocDenseLocalList
  • Option to use a string in loadLocs for the values, instead of having to convert to chars and back?

Good enough for now.