Skip to content

Commit 1394be1

Browse files
committed
submission: Optimize equiv. Chunk lookup
1 parent 9a4c83f commit 1394be1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/submission.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ function eager_submit_internal!(ctx, state, task, tid, payload; uid_to_tid=Dict{
5454
# N.B. Different Chunks with the same DRef handle will hash to the same slot,
5555
# so we just pick an equivalent Chunk as our upstream
5656
if haskey(state.waiting_data, arg)
57-
arg = only(filter(o->o isa Chunk && o.handle == arg.handle, keys(state.waiting_data)))::Chunk
57+
newarg = nothing
58+
for other in keys(state.waiting_data)
59+
if other isa Chunk && other.handle == arg.handle
60+
newarg = other
61+
break
62+
end
63+
end
64+
@assert newarg !== nothing
65+
arg = newarg::Chunk
5866
end
5967
WeakChunk(arg)
6068
else

0 commit comments

Comments
 (0)