-
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
Splitting functionality into different Packages #4
Comments
Interesting! Any lessons learnt that you can share? For example, I've seen that you use
I'm almost done with adding several new types ( @mbauman I'm pinging you as a member of @JuliaArrays. What would be your recommendation about splitting this package and/or putting it under the @JuliaArrays umbrella? I don't have any experience with this kind of question. |
Since julia> using ImmutableVectors, SmallCollections
julia> im = ImmutableVector{7,Float16}(1,2,3,4)
4-element ImmutableVector{7, Float16}:
1.0
2.0
3.0
4.0
julia> sm = SmallVector{7,Float16}(im)
4-element SmallVector{7, Float16}:
1.0
2.0
3.0
4.0
julia> sizeof(im)
16
julia> sizeof(sm)
24
julia> imb = ImmutableVector{9,Bool}(1,0,0,0,1)
5-element ImmutableVector{9, Bool}:
1
0
0
0
1
julia> smb = SmallVector{9,Bool}(imb)
5-element SmallVector{9, Bool}:
1
0
0
0
1
julia> sizeof(imb)
10
julia> sizeof(smb)
24
julia> struct my_struct
a::Float16
l::Bool
end
julia> ims = ImmutableVector{7,my_struct}(my_struct(1,1))
1-element ImmutableVector{7, my_struct}:
my_struct(Float16(1.0), true)
julia> sms = SmallVector{7,my_struct}(ims)
1-element SmallVector{7, my_struct}:
my_struct(Float16(1.0), true)
julia> sizeof(ims)
30
julia> sizeof(sms)
40 The difference in size only goes away when using elements of 8 bytes (in 64bit systems): julia> im64 = ImmutableVector{6}(1.0,2.0,3.0)
3-element ImmutableVector{6, Float64}:
1.0
2.0
3.0
julia> sm64 = SmallVector{6}(im64)
3-element SmallVector{6, Float64}:
1.0
2.0
3.0
julia> sizeof(im64)
56
julia> sizeof(sm64)
56 However, an obvious disadvantage of using If I have time later I'll try including the |
In the meantime I added a type |
Cool, I'll try the master branch out. struct ImmutableVector{N,T,TL<:Integer} <: AbstractSmallVector{N,T}
b::Values{N,T}
n::TL
end
const SmallVector{N,T} = ImmutableVector{N, T, SmallLength}
export SmallVector |
That looks to complicated to me for such a minor aspect. |
Hi there!
The
SmallVector
provided by this package is something that I needed a while ago.I didn't find your package back then and ended up reproducing the functionality here.
I remember I looked into every package in the JuliaArrays organization looking for this.
I just found it through a comment of yours in a post in the Julia discourse forum.
Maybe I just didn't do enough research, but I thought it might be a good idea to split the functionality provided by this package into separate packages (e.g.,
SmallVectors.jl
,SmallDicts.jl
, etc.) and make this one a meta package that exports all of them.Then
SmallVectors
could live in the JuliaArray organization and maybe improve its discoverability.The text was updated successfully, but these errors were encountered: