Skip to content

Conversation

mateuszbaran
Copy link
Collaborator

I think it will be much easier to track potential performance regressions when pure removal is split into a few steps. This is the first one.

@mateuszbaran mateuszbaran added the housekeeping General project health label May 11, 2024
@mateuszbaran mateuszbaran merged commit c4092a1 into master May 16, 2024
@mateuszbaran mateuszbaran deleted the mbaran/no-more-pure branch May 16, 2024 12:49
Comment on lines +48 to +50
@generated function triangularroot(::Val{L}) where {L}
return div(isqrt(8 * L + 1) - 1, 2) # from quadratic formula
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this have to be a @generated function with a Val argument? To me it looks like constant propagation works like a charm for plain

triangularroot(L::Int) = div(isqrt(8 * L + 1) - 1, 2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's hard to tell for me how it would interact with inlining if it were a normal function. We can always change it in a later PR.

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

Successfully merging this pull request may close these issues.

2 participants