-
Notifications
You must be signed in to change notification settings - Fork 23
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
[WIP] 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 😢
Co-authored-by: Jiří Beneš <mail@jiribenes.com>
Co-authored-by: Jiří Beneš <mail@jiribenes.com>
ee9d209
to
58c8510
Compare
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).