-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutable dynamic arrays, heaps, and simple union find data structures #585
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far!
I had some time during the meeting, so I quickly wrote some observations. :)
// These numbers should be optimized based on benchmarking | ||
// According to https://en.wikipedia.org/wiki/Dynamic_array most use 1.5 or 2 | ||
// | ||
// Factor by which to grow the capacity when it becomes too small | ||
val growFactor = 1.5 | ||
// shrink array when size / capacity falls below this threshold | ||
// should be < 1/growFactor | ||
val shrinkThreshold = 0.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this requires #496 in order to work on LLVM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know 😢
ee9d209
to
58c8510
Compare
What happened to this PR, it looks really cool! :) |
@b-studios Mostly I didn't get around to doing much here since. The code is tested as far as the tests here go (so not much), but should mostly work (TM). |
72702b3
to
48bfc57
Compare
Co-authored-by: Jiří Beneš <mail@jiribenes.com>
Co-authored-by: Jiří Beneš <mail@jiribenes.com>
dc62953
to
597bded
Compare
Rebased, cleaned up a bit. Should be fine, except not tested well and not documented in too much detail, either. |
For writing examples, I wanted to have some standard mutable data structures, currently:
They all still need more documentation, testing and maybe some additional functions (I only implemented what I needed).