Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
dd11fc35
Commit
dd11fc35
authored
Mar 30, 2018
by
Samuel Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[LockingDependencyAnalyzer] Only add a dependency string to the graph once
This saves almost 2 seconds on our project
parent
282d50c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
locking_dependency_analyzer.rb
...coapods/installer/analyzer/locking_dependency_analyzer.rb
+9
-6
No files found.
lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
View file @
dd11fc35
...
@@ -33,6 +33,8 @@ module Pod
...
@@ -33,6 +33,8 @@ module Pod
dependency_graph
=
Molinillo
::
DependencyGraph
.
new
dependency_graph
=
Molinillo
::
DependencyGraph
.
new
if
lockfile
if
lockfile
added_dependency_strings
=
Set
.
new
explicit_dependencies
=
lockfile
.
dependencies
explicit_dependencies
=
lockfile
.
dependencies
explicit_dependencies
.
each
do
|
dependency
|
explicit_dependencies
.
each
do
|
dependency
|
dependency_graph
.
add_vertex
(
dependency
.
name
,
dependency
,
true
)
dependency_graph
.
add_vertex
(
dependency
.
name
,
dependency
,
true
)
...
@@ -40,7 +42,7 @@ module Pod
...
@@ -40,7 +42,7 @@ module Pod
pods
=
lockfile
.
to_hash
[
'PODS'
]
||
[]
pods
=
lockfile
.
to_hash
[
'PODS'
]
||
[]
pods
.
each
do
|
pod
|
pods
.
each
do
|
pod
|
add_to_dependency_graph
(
pod
,
[],
dependency_graph
,
pods_to_unlock
)
add_to_dependency_graph
(
pod
,
[],
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
end
end
pods_to_update
=
pods_to_update
.
flat_map
do
|
u
|
pods_to_update
=
pods_to_update
.
flat_map
do
|
u
|
...
@@ -67,7 +69,8 @@ module Pod
...
@@ -67,7 +69,8 @@ module Pod
private
private
def
self
.
add_child_vertex_to_graph
(
dependency_string
,
parents
,
dependency_graph
,
pods_to_unlock
)
def
self
.
add_child_vertex_to_graph
(
dependency_string
,
parents
,
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
return
unless
added_dependency_strings
.
add?
(
dependency_string
)
dependency
=
Dependency
.
from_string
(
dependency_string
)
dependency
=
Dependency
.
from_string
(
dependency_string
)
if
pods_to_unlock
.
include?
(
dependency
.
root_name
)
if
pods_to_unlock
.
include?
(
dependency
.
root_name
)
dependency
=
Dependency
.
new
(
dependency
.
name
)
dependency
=
Dependency
.
new
(
dependency
.
name
)
...
@@ -78,14 +81,14 @@ module Pod
...
@@ -78,14 +81,14 @@ module Pod
dependency
dependency
end
end
def
self
.
add_to_dependency_graph
(
object
,
parents
,
dependency_graph
,
pods_to_unlock
)
def
self
.
add_to_dependency_graph
(
object
,
parents
,
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
case
object
case
object
when
String
when
String
add_child_vertex_to_graph
(
object
,
parents
,
dependency_graph
,
pods_to_unlock
)
add_child_vertex_to_graph
(
object
,
parents
,
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
when
Hash
when
Hash
object
.
each
do
|
key
,
value
|
object
.
each
do
|
key
,
value
|
dependency
=
add_child_vertex_to_graph
(
key
,
parents
,
dependency_graph
,
pods_to_unlock
)
dependency
=
add_child_vertex_to_graph
(
key
,
parents
,
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
value
.
each
{
|
v
|
add_to_dependency_graph
(
v
,
[
dependency
.
name
],
dependency_graph
,
pods_to_unlock
)
}
value
.
each
{
|
v
|
add_to_dependency_graph
(
v
,
[
dependency
.
name
],
dependency_graph
,
pods_to_unlock
,
added_dependency_strings
)
}
end
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment