Skip to content
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

Get rid of StaticArrays #169

Closed
wants to merge 8 commits into from
Closed

Get rid of StaticArrays #169

wants to merge 8 commits into from

Conversation

SimonDanisch
Copy link
Member

And some other type clean ups.

@sjkelly
Copy link
Member

sjkelly commented Feb 25, 2022

This doesn't seem like the correct long term solution if we can cache precompiles between modules in 1.8+.

Xref discussion from a while back: #91

@SimonDanisch
Copy link
Member Author

if we can cache precompiles between modules in 1.8+.

That's not helping, since StaticArrays emits much harder code to compile...So until we cache binary, this is a valid approach.
I'm keeping the interface mainly the same, and this also helps remove complex code to wade through while optimizing Makie's compile times - while still allowing us to switch back to using StaticArrays once it makes sense.

Benchmarks indicating the utility of this PR are done with Julia already caching between modules. Since the new code is much less complicated it does indeed shave off around 1-3s.

See: MakieOrg/Makie.jl#1701
But yes, this opens up the discussion from #91. Since I'm touching all the Vec code, I'm willing to overthink the Vec/Point interface :)

@sjkelly sjkelly self-requested a review March 15, 2022 19:58
@sjkelly
Copy link
Member

sjkelly commented Mar 15, 2022

This does share some time off Plots also:

julia> @time using Plots
  3.701392 seconds (6.20 M allocations: 496.627 MiB, 4.59% gc time, 21.38% compilation time)
julia> @time using Plots
  3.452578 seconds (6.12 M allocations: 487.336 MiB, 4.05% gc time, 22.26% compilation time)

Copy link
Contributor

@hyrodium hyrodium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some suggestions around StaticArraysCore.jl

import Random
import Base: setindex

abstract type StaticVector{N, T} end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have StaticArraysCore.jl, so this definition can be removed.

@@ -7,6 +7,7 @@ version = "0.4.2"
EarCut_jll = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"

@@ -1,10 +1,12 @@
module GeometryBasics

using StaticArrays, Tables, StructArrays, IterTools, LinearAlgebra
using Tables, StructArrays, IterTools, LinearAlgebra
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using Tables, StructArrays, IterTools, LinearAlgebra
using StaticArraysCore, Tables, StructArrays, IterTools, LinearAlgebra

@SimonDanisch
Copy link
Member Author

I'm going to close this for now.

  1. Compile times are pretty good with package images
  2. We started re-implementing large parts of staticarrays, which seems better spend on improving StaticArrays compile times itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants