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

Fix the inference issues in apply by removing @assume_effects :foldable #245

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions GeometryOpsCore/src/apply.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,12 @@ using Base.Threads: nthreads, @threads, @spawn
return mapreduce(fetch, vcat, tasks)
end
#=
Here we use the compiler directive `@assume_effects :foldable` to force the compiler
Here we used to use the compiler directive `@assume_effects :foldable` to force the compiler
to lookup through the closure. This alone makes e.g. `flip` 2.5x faster!

But it caused inference to fail, so we've removed it. No effect on runtime so far as we can tell,
at least in Julia 1.11.
=#
Base.@assume_effects :foldable @inline function _maptasks(f::F, taskrange, threaded::_False)::Vector where F
@inline function _maptasks(f::F, taskrange, threaded::_False)::Vector where F
map(f, taskrange)
end
Loading