-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feature request] Fallback storage beyond capacity #3
Comments
Yes, that's correct.
I think that this is an interesting idea and possible to do. Instead of modifying existing types, I would define new ones. One would have to see how much the new feature affects performance, but it would be worth a try. That being said, I cannot promise that if I will find enough time in the near future to do this. I'm currently finishing up the addition of |
I made a bare-bones package ShortVectors.jl that does this. It's quite simple: it is a wrapper around a I've only done limited benchmarking, but so far it seems to work about as I expect. (I did run into a couple of performance gotchas that I don't fully understand, but had reasonable workarounds.) In principle there could also be a mutable version, but it is less clear to me how to do that and whether there would be much performance gains (since I think Julia requires mutable objects to be on the heap). |
I believe that so far you have implemented |
That's correct. As I said, it is bare bones. And for my immediate use case it is sufficient. Basically, I just want variable length tuples that I can store locally in homogeneous arrays and quickly iterate through. But I agree it is not super easy to benchmark that kind of workload. |
If I understand correctly,
SmallVector
and other collections implemented in this package have a fixed capacity, meaning it is impossible to store more than the number of items specified by the type parameter. As per this discussion on Julia discourse, a very desirable feature would be the ability to occasionally store more than this amount, while retaining stack allocation in the case that the number of items is within the specified capacity. There is even a sketch of a solution there.Would it be very difficult to add this feature to the collection types defined here? I think we should try to avoid having another package that also implements small vectors.
The text was updated successfully, but these errors were encountered: