Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11732 closed enhancement (fixed)

faster import of sage.interacts.all

Reported by: saraedum Owned by: itolkov, jason
Priority: minor Milestone: sage-4.7.2
Component: interact Keywords: sd32
Cc: Merged in: sage-4.7.2.alpha3
Authors: Julian Rueth Reviewers: William Stein
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by leif)

sage.interact.all imports functions which have controls from sagenb.notebook.interact as default parameters. These take some time to initialize. The attached patch improves this situation:

$ dumbbench -- ./sage --startuptime
Ran 23 iterations (3 outliers).
Rounded run time per iteration: 1.001e+00 +/- 2.2e-02 (2.2%)

vs.

$ dumbbench -- ./sage --startuptime
Ran 24 iterations (4 outliers).
Rounded run time per iteration: 9.56e-01 +/- 1.7e-02 (1.8%)

Apply only trac_11732_sagenb_interact.proper.patch to the SageNB repository.

Attachments (2)

trac_11732_sagenb_interact.patch (9.9 KB) - added by saraedum 10 years ago.
trac_11732_sagenb_interact.proper.patch (9.8 KB) - added by leif 10 years ago.
"Proper" Mercurial changeset replacement patch.

Download all attachments as: .zip

Change History (12)

Changed 10 years ago by saraedum

comment:1 Changed 10 years ago by saraedum

  • Status changed from new to needs_review

comment:2 Changed 10 years ago by saraedum

  • Authors changed from Julian Rüth to Julian Rueth

comment:3 Changed 10 years ago by was

  • Status changed from needs_review to positive_review

I'm not sure this matters much for startuptime (it's hard to tell). But the code itself seems good and clean, and works. So positive review.

comment:4 Changed 10 years ago by was

  • Keywords sd32 added

comment:5 Changed 10 years ago by leif

  • Description modified (diff)
  • Reviewers set to William Stein

Again, attachment comments make life easier, and putting the patches to apply into the description simplifies things.

comment:6 Changed 10 years ago by leif

  • Description modified (diff)

comment:7 Changed 10 years ago by leif

  • Merged in set to sage-4.7.2.alpha3
  • Resolution set to fixed
  • Status changed from positive_review to closed

Changed 10 years ago by leif

"Proper" Mercurial changeset replacement patch.

comment:8 Changed 10 years ago by leif

  • Description modified (diff)

I've attached a *.proper.patch, which is identical except that I removed the "garbage" before "# HG changeset patch", i.e., I deleted the first line "exporting patch:", since Jeroen's current merger rejects such patches.

For now, please make sure all your patches start with "# HG changeset patch", i.e., have it on the first line without any preceding messages or whatever.

I've relaxed that in my version of the merger, but Jeroen and maybe others are likely to use his more restrictive one.

comment:9 Changed 10 years ago by kini

This patch does not apply to the flask notebook trivially, and I'm probably not very qualified to do a rebasing myself. Anyone feel like looking into it? Latest version is at https://github.com/sagemath/sagenb/, a version a few days old is at http://code.google.com/r/jasongrout-flask-sagenb/.

Note: See TracTickets for help on using tickets.