#4845: [with patch, positive review] sage 3.2.2 crashes on startup when 
init.sage
present
------------------------+---------------------------------------------------
 Reporter:  craigcitro  |        Owner:  craigcitro
     Type:  defect      |       Status:  closed    
 Priority:  blocker     |    Milestone:  sage-3.2.3
Component:  misc        |   Resolution:  fixed     
 Keywords:              |  
------------------------+---------------------------------------------------
Comment (by craigcitro):

 I definitely prefer the v2 patch for the sake of readability. For the sake
 of it, though, should anyone look at this ticket, I want to note that the
 original patch seems (at a quick glance, anyway) to be faster:

 {{{
 sage: s = ""
 sage: %timeit s.startswith('3')
 1000000 loops, best of 3: 350 ns per loop
 sage: %timeit s and s[0] == '3'
 10000000 loops, best of 3: 72.2 ns per loop

 sage: s = "345"
 sage: %timeit s.startswith('3')
 1000000 loops, best of 3: 353 ns per loop
 sage: %timeit s and s[0] == '3'
 1000000 loops, best of 3: 208 ns per loop

 sage: s = "678"
 sage: %timeit s.startswith('3')
 1000000 loops, best of 3: 351 ns per loop
 sage: %timeit s and s[0] == '3'
 1000000 loops, best of 3: 212 ns per loop
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4845#comment:7>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to