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

Small performance tweaks #772

Merged
merged 14 commits into from
Jun 25, 2024
Merged

Small performance tweaks #772

merged 14 commits into from
Jun 25, 2024

Conversation

palday
Copy link
Member

@palday palday commented Jun 21, 2024

Thanks for contributing!

Did behavior change? Did you add need features? If so, please update NEWS.md

  • add entry in NEWS.md
  • after opening this PR, add a reference and run docs/NEWS-update.jl to update the cross-references.

Should we release your changes right away? If so, bump the version:

  • I've bumped the version appropriately

@palday palday changed the title Pa/type_inference Small performance tweakks Jun 21, 2024
@palday palday changed the title Small performance tweakks Small performance tweaks Jun 21, 2024
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.93%. Comparing base (ce5b604) to head (33211b6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #772   +/-   ##
=======================================
  Coverage   96.93%   96.93%           
=======================================
  Files          34       34           
  Lines        3356     3358    +2     
=======================================
+ Hits         3253     3255    +2     
  Misses        103      103           
Flag Coverage Δ
current 96.87% <100.00%> (+<0.01%) ⬆️
minimum 96.83% <100.00%> (+<0.01%) ⬆️
nightly 96.43% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -408,7 +408,7 @@ function createAL(reterms::Vector{<:AbstractReMat{T}}, Xy::FeMat{T}) where {T}
end
end
end
return A, L
return identity.(A), identity.(L)
Copy link
Member Author

Choose a reason for hiding this comment

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

this will tighten up the eltype of the vector when all elements are of a single type

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is a good idea but I don't think it will change things in the current setup. At least for L, first(L) is always Diagonal or UniformBlockDiagonal and last{L) is always Matrix{T}.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that matches my own sanity checks. I have some further ideas building upon this, but haven't had time to experiment more. 😄

src/linearmixedmodel.jl Outdated Show resolved Hide resolved
@palday palday force-pushed the pa/type_inference branch from b4d32e1 to 1bab6e7 Compare June 22, 2024 23:08
@palday palday marked this pull request as ready for review June 24, 2024 19:58
@@ -31,63 +31,40 @@ The latter four fields are MixedModels functionality and not related directly to
the future to use a different subtype of `AbstractVector` (e.g., `StaticArrays.SVector`)
for each snapshot without being considered a breaking change.
"""
mutable struct OptSummary{T<:AbstractFloat}
Base.@kwdef mutable struct OptSummary{T<:AbstractFloat}
Copy link
Member Author

Choose a reason for hiding this comment

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

I hope that this will make some things easier to maintain

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea.

src/optsummary.jl Outdated Show resolved Hide resolved
src/optsummary.jl Outdated Show resolved Hide resolved
palday and others added 5 commits June 24, 2024 15:04
@palday palday requested a review from dmbates June 24, 2024 20:18
MixedModels v4.24.1 Release Notes
==============================
Add type notations in `pwrss(::LinearMixedModel)` and `logdet(::LinearMixedModel)` to enhance type inference. [#773]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for picking up that I had set the version to the wrong value and had the notes in the wrong place.

A::Vector{AbstractMatrix{T}} # cross-product blocks
L::Vector{AbstractMatrix{T}}
A::Vector{<:AbstractMatrix{T}} # cross-product blocks
L::Vector{<:AbstractMatrix{T}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, thanks for picking this up. This is a sign that you write a lot of Julia code.

@@ -31,63 +31,40 @@ The latter four fields are MixedModels functionality and not related directly to
the future to use a different subtype of `AbstractVector` (e.g., `StaticArrays.SVector`)
for each snapshot without being considered a breaking change.
"""
mutable struct OptSummary{T<:AbstractFloat}
Base.@kwdef mutable struct OptSummary{T<:AbstractFloat}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good idea.

@palday palday merged commit 34899cf into main Jun 25, 2024
12 checks passed
@palday palday deleted the pa/type_inference branch June 25, 2024 17:27
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.

2 participants