-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
ScopedValue is allocating when accessed #53584
Comments
This is probably caused by 5b2fcb6 and is not multi-threading related: julia> const dynvec = ScopedValue([0])
julia> @noinline function dynfun()
dvec = dynvec[]
dvec[1] += 1
return nothing
end
julia> foo() = @with dynvec=>[0] for _ in 1:1000_000; dynfun(); end
julia> @allocated foo()
16000208 The problem is this Line 1004 in 58291db
|
So is the problem there that the API wrongly returns an object of type |
Would |
I guess not. Apparently we do not have calling convention support for |
I have looked into using scoped values for some temporary arrays to avoid allocations in parallel tasks. However, it seems scoped values are allocating when accessed, whereas with tls it can be avoided. This is unfortunate, since gc in parallel tasks can be a performance problem.
output:
The text was updated successfully, but these errors were encountered: