summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-10-13 17:14:42 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-10-13 19:46:57 -0700
commit3f091fb6db627e3e780b27757dc8edfec117cb38 (patch)
tree5ee4f6cad4efcc0f233575a11dee426de2e53219 /lib
parentf58c5030912d612140ef7177825f9d78babe62bf (diff)
downloadspack-3f091fb6db627e3e780b27757dc8edfec117cb38.tar.gz
spack-3f091fb6db627e3e780b27757dc8edfec117cb38.tar.bz2
spack-3f091fb6db627e3e780b27757dc8edfec117cb38.tar.xz
spack-3f091fb6db627e3e780b27757dc8edfec117cb38.zip
Use list instead of OrderedDict to find virtual/external candidates
- This reduces concretization time for r-rminer from over 1 minute to only 16 seconds. - OrderedDict ends up taking a *lot* of time to compare larger specs. - An OrderedDict isn't actually needed here. It's actually not possible to find duplicates, and we end up sorting the contents of the OrderedDict anyway.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/concretize.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index 10a3705083..af3f3a3b18 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -37,7 +37,6 @@ from __future__ import print_function
from six import iteritems
from spack.version import *
from itertools import chain
-from ordereddict_backport import OrderedDict
from functools_backport import reverse_order
import spack
@@ -80,17 +79,15 @@ class DefaultConcretizer(object):
# For each candidate package, if it has externals, add those
# to the usable list. if it's not buildable, then *only* add
# the externals.
- #
- # Use an OrderedDict to avoid duplicates (use it like a set)
- usable = OrderedDict()
+ usable = []
for cspec in candidates:
if is_spec_buildable(cspec):
- usable[cspec] = True
+ usable.append(cspec)
externals = spec_externals(cspec)
for ext in externals:
if ext.satisfies(spec):
- usable[ext] = True
+ usable.append(ext)
# If nothing is in the usable list now, it's because we aren't
# allowed to build anything.