Ticket #3564 (closed enhancement: fixed)

Opened 3 months ago

Last modified 3 months ago

[with patch; positive review] optimize sage startup: don't import sympy by default

Reported by: was Assigned to: gfurnish
Priority: major Milestone: sage-3.0.6
Component: calculus Keywords:
Cc:

Description

The attached patch works and speeds up the sage import from between 0.1 and 0.5 seconds, depending on caching.

NOTE: It is necessary to fix a bug in sympy first.

11:57 < wstein> The fix would be to change line 99 of printing/pretty/pretty_symbology.py to
11:57 < wstein>             try:
11:57 < wstein>                encoding = sys.stdout.encoding
11:57 < wstein>             except AttributeError: return
11:58 < wstein> Yep, that 100% fixes the problem.
11:58 < ondrej> ok, I'll commit it. thanks
11:58 < wstein> Maybe you already did that?
11:58 < wstein> It is right, I think, since you do almost the same thing 2 lines later.

Attachments

sage-3564.patch (1.6 kB) - added by was on 07/06/2008 12:03:59 PM.

Change History

07/06/2008 12:03:26 PM changed by was

To verify that this indeed fixes the "sympy gets imported" problem, do this:

teragon-2:calculus was$ sage -startuptime |grep sympy teragon-2:calculus was$

after applying the startuptime patch: #3559

07/06/2008 12:03:59 PM changed by was

  • attachment sage-3564.patch added.

07/06/2008 12:04:34 PM changed by was

This bug is fixed in the new version of sympy:

12:01 < ondrej> now it is not
12:01 < ondrej> we fixed that in 0.5.15
12:01 < ondrej> bug I fixed important bug in our hg
12:01 < ondrej> and I am releasing the whole weekend...
12:02 < ondrej> (important sage<-> sympy bug)
12:02 < ondrej> so when I release, I'll create a spkg

07/06/2008 12:07:55 PM changed by certik

Thanks for the bug report. This is fixed in sympy 0.5.15. Sympy 0.5.16 that is about to be released tomorrow fixes another important bug with sympy matrices in Sage, so I'll create a new spkg tomorrow, or on Tuesday the latest.

07/07/2008 03:39:46 PM changed by certik

A new sympy-0.6.0.spkg together with a patch for sage was attached to #3592.

07/15/2008 11:07:01 PM changed by mabshoff

  • summary changed from [with patch; needs review] optimize sage startup: don't import sympy by default to [with patch; positive review] optimize sage startup: don't import sympy by default.

The does what it advertises, "testall long" passes with the patch applied. Positive review.

Cheers,

Michael

07/15/2008 11:07:19 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.0.6.alpha1