Skip to content
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

improve latency: specify element type explicitly in each comprehension #314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/deps_compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function find_missing_deps_compat(
compat = get(prj, "compat", Dict{String,Any}())

missing_compat = sort!(
[
PkgId[
d for d in map(d -> PkgId(UUID(last(d)), first(d)), collect(deps)) if
!(d.name in keys(compat)) && !(d.name in String.(ignore))
];
Expand Down
2 changes: 1 addition & 1 deletion src/persistent_tasks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function find_persistent_tasks_deps(package::PkgId; kwargs...)
id = PkgId(UUID(uuid), name)
return has_persistent_tasks(id; kwargs...)
end
return [name for (name, _) in deps]
return String[name for (name, _) in deps]
end

function find_persistent_tasks_deps(package::Module; kwargs...)
Expand Down
6 changes: 3 additions & 3 deletions src/project_extras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ function analyze_project_extras(pkg::PkgId)
is_julia12_or_later(julia_version) && return String[]

# `extras_test_deps`: test-only dependencies according to Project.toml
deps = [PkgId(UUID(v), k) for (k, v) in get(root_project, "deps", Dict{String,Any}())]
deps = PkgId[PkgId(UUID(v), k) for (k, v) in get(root_project, "deps", Dict{String,Any}())]
target =
Set{String}(get(get(root_project, "targets", Dict{String,Any}()), "test", String[]))
extras_test_deps = setdiff(
[
PkgId[
PkgId(UUID(v), k) for
(k, v) in get(root_project, "extras", Dict{String,Any}()) if k in target
],
Expand All @@ -56,7 +56,7 @@ function analyze_project_extras(pkg::PkgId)

# `test_deps`: test-only dependencies according to test/Project.toml:
test_deps = setdiff(
[PkgId(UUID(v), k) for (k, v) in get(test_project, "deps", Dict{String,Any}())],
PkgId[PkgId(UUID(v), k) for (k, v) in get(test_project, "deps", Dict{String,Any}())],
deps,
[PkgId(UUID(root_project["uuid"]), root_project["name"])],
)
Expand Down
8 changes: 4 additions & 4 deletions src/stale_deps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function find_stale_deps(pkg::PkgId; ignore::AbstractVector{Symbol} = Symbol[])
found || error("Unable to locate Project.toml")

prj = TOML.parsefile(root_project_path)
deps = [PkgId(UUID(v), k) for (k, v) in get(prj, "deps", Dict{String,Any}())]
weakdeps = [PkgId(UUID(v), k) for (k, v) in get(prj, "weakdeps", Dict{String,Any}())]
deps = PkgId[PkgId(UUID(v), k) for (k, v) in get(prj, "deps", Dict{String,Any}())]
weakdeps = PkgId[PkgId(UUID(v), k) for (k, v) in get(prj, "weakdeps", Dict{String,Any}())]

marker = "_START_MARKER_"
code = """
Expand Down Expand Up @@ -85,9 +85,9 @@ function find_stale_deps_2(;
pkgid_from_uuid = Dict(p.uuid => p for p in deps)

stale_uuids = setdiff(deps_uuids, loaded_uuids)
stale_pkgs = [pkgid_from_uuid[uuid] for uuid in stale_uuids]
stale_pkgs = PkgId[pkgid_from_uuid[uuid] for uuid in stale_uuids]
stale_pkgs = setdiff(stale_pkgs, weakdeps)
stale_pkgs = [p for p in stale_pkgs if !(Symbol(p.name) in ignore)]
stale_pkgs = PkgId[p for p in stale_pkgs if !(Symbol(p.name) in ignore)]

return stale_pkgs
end
Loading