@@ -349,18 +349,15 @@ function getdict(data::Vector{UInt})
349
349
end
350
350
351
351
function getdict! (dict:: LineInfoDict , data:: Vector{UInt} )
352
- # we don't want metadata here as we're just looking up ips
353
- unique_data_itr = Iterators. unique (has_meta (data) ? strip_meta (data) : data)
354
- foreach (ip -> dict[UInt64 (ip)] = StackFrame[], unique_data_itr)
355
- @sync for ip in unique_data_itr
356
- Threads. @spawn begin
357
- st = lookup (convert (Ptr{Cvoid}, ip))
358
- # To correct line numbers for moving code, put it in the form expected by
359
- # Base.update_stackframes_callback[]
360
- stn = map (x-> (x, 1 ), st)
361
- try Base. invokelatest (Base. update_stackframes_callback[], stn) catch end
362
- dict[UInt64 (ip)] = map (first, stn)
363
- end
352
+ for ip in data
353
+ # Lookup is expensive, so do it only once per ip.
354
+ haskey (dict, UInt64 (ip)) && continue
355
+ st = lookup (convert (Ptr{Cvoid}, ip))
356
+ # To correct line numbers for moving code, put it in the form expected by
357
+ # Base.update_stackframes_callback[]
358
+ stn = map (x-> (x, 1 ), st)
359
+ try Base. invokelatest (Base. update_stackframes_callback[], stn) catch end
360
+ dict[UInt64 (ip)] = map (first, stn)
364
361
end
365
362
return dict
366
363
end
0 commit comments