#20078: Minimal non faces of simplicial complexes: Improve speed
-------------------------------------+-------------------------------------
Reporter: jipilab | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-7.1
Component: algebraic | Resolution:
topology | Merged in:
Keywords: simplicial | Reviewers:
complex, minimal nonface | Work issues:
Authors: Jean-Philippe | Commit:
Labbé | a26ad0bfff0273656cebb060691056dd75fc2f7b
Report Upstream: N/A | Stopgaps:
Branch: |
u/jipilab/minnonface |
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by tscrim):
Just from a quick lookthrough:
- I would use `itertools` instead `Subsets`:
{{{
sage: S = (1,2,3,4)
sage: %timeit list(Subsets(S,2))
10000 loops, best of 3: 162 µs per loop
sage: %timeit list(itertools.combinations(S,2))
The slowest run took 27.61 times longer than the fastest. This could mean
that an intermediate result is being cached.
1000000 loops, best of 3: 907 ns per loop
sage: S = range(20)
sage: %timeit list(itertools.combinations(S,9))
100 loops, best of 3: 14.8 ms per loop
sage: %timeit list(Subsets(S,9))
1 loop, best of 3: 3.8 s per loop
}}}
(Actually, we probably should change the iterator for `Subset` to use
`itertools`.)
- In general, I would try to avoid using Sage's `Set` at much as possible
(which we should cythonize). Instead, I would use python's
(`frozen`)`set`s. This way we avoid the overhead.
--
Ticket URL: <http://trac.sagemath.org/ticket/20078#comment:13>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.