Opened 9 years ago

Closed 9 years ago

#13361 closed enhancement (fixed)

Report startuptime exclusive children

Reported by: vbraun Owned by: tbd
Priority: major Milestone: sage-5.4
Component: performance Keywords:
Cc: Merged in: sage-5.4.beta2
Authors: Volker Braun Reviewers: John Palmieri
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jhpalmieri)

Right now sage -startuptime reports startup time including children. This isn't particularly useful since that just means that the first module (which loads most of sage as dependencies) is the slowest. The more meaningful number is exclusive children, which can tell us if the module does computations during initialization.

Attachments (6)

trac_12883_startuptime.patch (4.9 KB) - added by vbraun 9 years ago.
Initial patch
trac_13361_startuptime_args.patch (647 bytes) - added by vbraun 9 years ago.
Initial patch
trac_13361_startuptime.patch (6.7 KB) - added by vbraun 9 years ago.
Improved patch
trac_13361_fix_test.patch (601 bytes) - added by vbraun 9 years ago.
Initial patch
trac_13361-root-referee.patch (1.1 KB) - added by jhpalmieri 9 years ago.
root repo: documentation
trac_13361-sagelib-referee.patch (1.8 KB) - added by jhpalmieri 9 years ago.
Sage library: documentation and doctest fix

Download all attachments as: .zip

Change History (18)

Changed 9 years ago by vbraun

Initial patch

comment:1 Changed 9 years ago by vbraun

  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 Changed 9 years ago by vbraun

  • Description modified (diff)

Changed 9 years ago by vbraun

Initial patch

comment:3 Changed 9 years ago by vbraun

  • Description modified (diff)

Now with disabled garbage collector (it did skew timings) and with optional argument a module that you want to know more about:

[vbraun@laptop sage]$ sage -startuptime sage.geometry.fan

========================================================================
== Slowest modules imported by sage.geometry.fan =======================
exclude/ms include/ms   #parents  module name
     0.114     51.802          3  sage.geometry.all
     0.220      0.240          1  sage.schemes.toric.library
     0.353      0.414          1  sage.geometry.triangulation.fan_refinement
     0.404      0.492          2  sage.geometry.fan_morphism
     0.688      0.962          3  sage.schemes.toric.variety

== Slowest modules importing sage.geometry.fan =========================
exclude/ms include/ms   #parents  module name
     0.526      2.551         19  collections
     0.607    139.657         51  sage.misc.all
     0.617     67.490          5  sage.combinat.posets.posets
     0.770      2.764          4  sage.geometry.lattice_polytope
     0.779     49.771          5  sage.geometry.cone
     1.123      1.126        175  sage.misc.abstract_method
     1.243      1.243        180  sage.misc.lazy_attribute
     1.284     66.645        230  sage.rings.all
     1.350      1.350         63  copy
     3.897      5.520        218  sage.misc.sageinspect

== module sage.geometry.fan ============================================
Time to import:  0.760ms
Cumulative time: 0.835ms
Names: fan, sage.geometry.fan
Version 0, edited 9 years ago by vbraun (next)

Changed 9 years ago by vbraun

Improved patch

comment:4 Changed 9 years ago by vbraun

New patch has better handling of ambiguous command line argument and prints module file.

Changed 9 years ago by vbraun

Initial patch

comment:5 Changed 9 years ago by vbraun

  • Description modified (diff)

comment:6 Changed 9 years ago by jhpalmieri

  • Description modified (diff)
  • Reviewers set to John Palmieri

Two questions:

  • would it be useful to be able to sort by times including children (keeping the default as is) by specifying a command-line argument? (I don't know the answer to this one.)
  • should the usage sage --startuptime [modulename] be documented in sage --advanced and in devel/sage/doc/en/reference/options.rst? (I think the answer to this one is "yes". See the attached referee patches.)

Changed 9 years ago by jhpalmieri

root repo: documentation

comment:7 Changed 9 years ago by vbraun

I don't think there is much point in the inclusive startup time, that just tells you which library was imported first (and then pulled in a lot of sage modules for the first time). Thats why the old startuptime always showed a ridiculously long time for sage.algebras.iwahori_hecke_algebra despite this being a very lightweight module.

Thanks for the referee patches, they look great!

comment:8 Changed 9 years ago by jhpalmieri

  • Status changed from needs_review to positive_review

comment:9 Changed 9 years ago by jhpalmieri

  • Status changed from positive_review to needs_work

Oops, we missed one thing: the test in tests/startup.py has to be rewritten to take into account the changed output of sage --startuptime. (This will only make a difference when testing on sage.math.)

comment:10 Changed 9 years ago by jhpalmieri

  • Status changed from needs_work to needs_review

I've added to my referee's patch to fix the doctest in tests/startup.py. Also, now if the test fails, it prints how long sage --startuptime took, instead of just returning False.

Changed 9 years ago by jhpalmieri

Sage library: documentation and doctest fix

comment:11 Changed 9 years ago by vbraun

  • Status changed from needs_review to positive_review

Hmm a hostname-dependent doctest ;-)

Thanks for the patch, looks good!

comment:12 Changed 9 years ago by jdemeyer

  • Merged in set to sage-5.4.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.