On 10/3/07, David Joyner <[EMAIL PROTECTED]> wrote:
>
> On 10/3/07, Jason Grout <[EMAIL PROTECTED]> wrote:
> >
> > Does anyone have a clue why constructing subsets might be so slow?
> >
> > $ sage
> > ----------------------------------------------------------------------
> > | SAGE Version 2.8.5.1, Release Date: 2007-09-26 |
> > | Type notebook() for the GUI, and license() for information. |
> > ----------------------------------------------------------------------
> >
> > sage: %time x=list(Subsets(25,5))
> > CPU times: user 15.01 s, sys: 1.02 s, total: 16.03 s
> > Wall time: 39.74
> > sage: %time x=list(Subsets(25,5))
> > CPU times: user 21.90 s, sys: 0.36 s, total: 22.26 s
> > Wall time: 23.85
> >
> > In Mathematica:
> > $ math
> > Mathematica 6.0 for Linux x86 (32-bit)
> > Copyright 1988-2007 Wolfram Research, Inc.
> >
> > In[1]:= Timing[Subsets[Range[25], {5}];]
> >
> > Out[1]= {0.028001, Null}
> >
> >
> > Is it the calls to GAP that are consuming all the time? If so, I'll try
> > to submit a patch that does subset enumeration natively in Python.
I haven't really spent a whole lot of time into optimizing certain
areas -- I was mostly trying to get lots of features added then then
optimize them. Right now the chain looks like Subsets -> Subwords ->
Combinations -> GAP which is pretty awful. I've fixed it, and it'll
be in 2.8.6.
sage: time a = Subsets(25, 5).list()
CPU times: user 0.78 s, sys: 0.06 s, total: 0.85 s
Wall time: 0.86
sage: len(a)
53130
--Mike
--Mike
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---