Skip to content

Feature/red black trees#466

Draft
remexre wants to merge 17 commits into
developfrom
feature/red-black-trees
Draft

Feature/red black trees#466
remexre wants to merge 17 commits into
developfrom
feature/red-black-trees

Conversation

@remexre

@remexre remexre commented Feb 2, 2021

Copy link
Copy Markdown
Member

Changes

Adds sets, maps, and multimaps implemented directly in Silver.
This lets them share structure, which should reduce peak memory use and GC pressure.

This is on top of feature/docgen, so waiting on it to be merged first.

Documentation

  • A comment on the implementation points to a better explanation than I can write of the deletion algorithm
  • The basic RBT operations are as in Okasaki (I suppose I could put a page number etc there too)
  • Doc comments are yet to be written, will do that before making this no-longer-a-draft
  • I still need to implement join and split; I'll comment those once they're written

Testing

  • Property tests would be worth doing?

Performance

  • I'll start using these in Silver and do actual performance comparisons before this is merged.
  • The case where I think this is an obvious win is synthesized attributes that are sets, which are currently (often) represented as linked lists.
  • Eric and I briefly discussed having a more generic environment library; in principle, I'd assume that one could do one that saved a bunch of work with laziness.

TODOs

  • join, split (for faster set operations)
  • Write doc comments
  • Use these in Silver
  • Compare performance to treeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants