Skip to content

Commit

Permalink
rename var for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Jul 20, 2021
1 parent 4aa9b53 commit a24fb7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ function __init__()
if haskey(ENV, "JULIA_MAX_NUM_PRECOMPILE_FILES")
MAX_NUM_PRECOMPILE_FILES[] = parse(Int, ENV["JULIA_MAX_NUM_PRECOMPILE_FILES"])
end
append!(empty!(LOAD_TIMING), zeros(Int, Threads.nthreads()))
append!(empty!(TIMING_IMPORTS), zeros(Int, Threads.nthreads()))
nothing
end

Expand Down
4 changes: 2 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ function _require_from_serialized(path::String)
end

# use an Int counter so that nested @time_imports calls all remain open
const LOAD_TIMING = Int[] # initialized in __init__
const TIMING_IMPORTS = Int[] # initialized in __init__

# returns `true` if require found a precompile cache for this sourcepath, but couldn't load it
# returns `false` if the module isn't known to be precompilable
Expand Down Expand Up @@ -859,7 +859,7 @@ function _require_search_from_serialized(pkg::PkgId, sourcepath::String, depth::
if isa(restored, Exception)
@debug "Deserialization checks failed while attempting to load cache from $path_to_try" exception=restored
else
if LOAD_TIMING[Threads.threadid()] > 0
if TIMING_IMPORTS[Threads.threadid()] > 0
elapsed = round((time_ns() - t_before) / 1e6, digits = 1)
tree_prefix = depth == 0 ? "" : "$(" "^(depth-1))"
print("$(lpad(elapsed, 9)) ms ")
Expand Down
4 changes: 2 additions & 2 deletions stdlib/InteractiveUtils/src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ end
macro time_imports(ex)
quote
try
Base.LOAD_TIMING[Threads.threadid()] += 1
Base.TIMING_IMPORTS[Threads.threadid()] += 1
$(esc(ex))
finally
Base.LOAD_TIMING[Threads.threadid()] -= 1
Base.TIMING_IMPORTS[Threads.threadid()] -= 1
end
end
end
Expand Down

0 comments on commit a24fb7e

Please sign in to comment.