On Apr 8, 2009, at 13:29 , John H Palmieri wrote:

>
> On Apr 8, 1:10 pm, William Stein <wst...@gmail.com> wrote:
>> On Wed, Apr 8, 2009 at 1:06 PM, John H Palmieri  
>> <jhpalmier...@gmail.com> wrote:
>>
>>> I'll mark mine as a duplicate.  Go ahead with your patch.
>>
>> Neither Justin nor I have a patch, and I don't think either of us are
>> working on one.
>
> Justin posted on his ticket "I'll attach a patch when the testing is
> complete (or try again if testing fails)." It sounded from this and
> earlier comments on the ticket as though he had a patch and it was
> equivalent to mine.

Since yours is there, let's use it.

>> I posted this on your patch, which slows str down by a factor of 12
>> (in this example):
>>
>> Needs work.  There is a *very good* reason that there is a str method
>> for GF(2) -- it's for speed!  Check this out:
>> {{{
>> BEFORE YOUR PATCH:
>> sage: a = random_matrix(GF(2),1000)
>> sage: time b = a.str()
>> CPU times: user 0.41 s, sys: 0.01 s, total: 0.42 s
>> Wall time: 0.42 s}}}
>>
>> {{{
>> AFTER YOUR PATCH:
>> sage: a = random_matrix(GF(2),1000)
>> sage: time b = a.str()
>> CPU times: user 5.02 s, sys: 0.86 s, total: 5.88 s
>> Wall time: 5.89 s
>>
>> }}}
>
> So this means duplicating the subdivisions part of the general matrix
> str function for the mod 2 case?

As a first cut, why not use the local str() method unless subdivisions  
are in place.  There may be a performance issue in determining the  
latter (ISTR that this requires using "try: except:", which is a bit  
painful if the 'except' branch is taken).

I had spent some time a while back trying to clean up the subdivision  
code, but got waylaid and haven't found my way back to that particular  
clearing...

But first things first.  We should fix the mod2 case, then worry about  
the rest.

I would hazard the guess that non-mod2 'str' processing will suffer  
the same performance issue, so maybe fix all at the same time?  I.e.,  
support subdivisions for mod2 strings and improve performance for non- 
mod2 strings.

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
When LuteFisk is outlawed,
Only outlaws will have LuteFisk
--------




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to