diff --git a/Project.toml b/Project.toml index 61ec084..a0da371 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MutatePlainDataArray" uuid = "3b0f367b-da20-4531-811a-c13cc92422b5" authors = ["Haoran Ni and contributors"] -version = "1.0.0-dev" +version = "1.0.0" [compat] julia = "1.6" diff --git a/README.md b/README.md index 0941def..0406418 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,9 @@ julia> b The mutation provided by this package is - **Efficient**. Under the hood, the mutation is achieved by pointer load/store, where the address offset is known at type inference time. - **Safe**. Compile-time type check is enforced. Reference to the original vector is obtained to prevent garbage collection. Bounds check is performed unless `@inbounds` is used. This package is inspired by and acts as a safer counterpart to [UnsafePointers.jl](https://github.com/cjdoris/UnsafePointers.jl). + +## See also + +[StructArrays.jl](https://github.com/JuliaArrays/StructArrays.jl) +[FieldViews.jl](https://github.com/MasonProtter/FieldViews.jl) +[BangBang.jl](https://github.com/JuliaFolds/BangBang.jl) diff --git a/benchmark/Project.toml b/benchmark/Project.toml index 793c965..ce25706 100644 --- a/benchmark/Project.toml +++ b/benchmark/Project.toml @@ -3,6 +3,7 @@ BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" MutatePlainDataArray = "3b0f367b-da20-4531-811a-c13cc92422b5" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [sources] MutatePlainDataArray = {path = ".."} diff --git a/benchmark/runbenchmarks.jl b/benchmark/runbenchmarks.jl index 85f46d8..5f6b88e 100644 --- a/benchmark/runbenchmarks.jl +++ b/benchmark/runbenchmarks.jl @@ -2,6 +2,9 @@ using MutatePlainDataArray using BenchmarkTools using Setfield using BangBang +using StaticArrays + +M = @SMatrix(ones(10,10)) struct BAB a::Int @@ -17,9 +20,9 @@ struct BAI1 c::Int d::Int bab::BAB - m::Float64 + m::typeof(M) end -BAI1() = BAI1(0, 0, 0, 0, BAB(), 100) +BAI1() = BAI1(0, 0, 0, 0, BAB(), M) function inbounds_setinner!_mutate(v, i)