Does it make sense to use both macros in a loop?
Threads.@threads @inbounds for i in 1:n
end
I mean, if you know that stuff is actually inbounds, then yes, using both can make sense and give performance improvements.
But generally it's a bad idea to put @inbounds
on an entire loop body. I prefer to only apply it to specific indexing calls so I can more easily reason about it
Júlio Hoffimann has marked this topic as resolved.
https://github.com/JuliaLang/julia/pull/41893
Good to know. Thanks for sharing.
Last updated: Jul 22 2025 at 04:56 UTC