Skip to content

Conversation

@KristofferC
Copy link
Member

I used JuliaLang/julia#60478 to find all the Core.Box instances in the package and then fix them. A variable that gets boxed like this will lose any type information, which can cascade into bad performance and vulnerability to invalidations.

The rules are basically that you cannot use a variable in a closure if that variable has been assigned to more than once. Also, using Base.@lock instead of lock() do avoids a closure. And if you have a closure that calls itself recursively, it is better to make that a normal function; otherwise, the closure itself will get boxed. Etc...

I used JuliaLang/julia#60478 to find all the `Core.Box` instances in the package and then fix them.
@bkamins bkamins added this to the patch milestone Dec 30, 2025
extrude = false

firstrow = first
wrapped_first = nothing
Copy link
Member

Choose a reason for hiding this comment

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

is this assignment needed? (we make sure not to access wrapped_first if extrude is false)

wrapped_first = nothing
lgd = length(gd)
if first isa AbstractDataFrame
if firstrow isa AbstractDataFrame
Copy link
Member

Choose a reason for hiding this comment

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

should eltys assignment be outside of if (as you did above in src/abstractdataframe/iteration.jl change)

@bkamins
Copy link
Member

bkamins commented Dec 30, 2025

Thank you for working on this. I left two small comments.

@bkamins bkamins requested a review from nalimilan December 30, 2025 09:12
Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

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

Thanks. It's too bad we need this kind of trick but...

end
len == -1 && (len = 1) # we got no vectors so make one row of scalars

len_val = len
Copy link
Member

Choose a reason for hiding this comment

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

Call this len_local like in other places to make it easier to guess why we do this?

@KristofferC
Copy link
Member Author

Updated

@bkamins
Copy link
Member

bkamins commented Jan 5, 2026

Thank you for working on this.

@bkamins bkamins merged commit 9a5854f into JuliaData:main Jan 5, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants