#14204: Building unchanged documentation takes very long
----------------------------+-----------------------------------------------
       Reporter:  jdemeyer  |         Owner:  GeorgSWeber
           Type:  defect    |        Status:  new        
       Priority:  blocker   |     Milestone:  sage-5.8   
      Component:  build     |    Resolution:             
       Keywords:            |   Work issues:             
Report Upstream:  N/A       |     Reviewers:             
        Authors:            |     Merged in:             
   Dependencies:            |      Stopgaps:             
----------------------------+-----------------------------------------------

Comment (by jhpalmieri):

 If I put a call to `cProfile` in the docbuild command in `spkg/bin/sage`
 when building `reference/homology`, it doesn't tell me much:
 {{{
          178370 function calls (174697 primitive calls) in 5.695 seconds

    Ordered by: internal time

    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
         2    4.087    2.043    4.087    2.043 {posix.waitpid}
        29    1.125    0.039    1.125    0.039 {method 'read' of 'file'
 objects}
         1    0.041    0.041    5.696    5.696 builder.py:12(<module>)
        15    0.019    0.001    0.032    0.002
 sre_compile.py:301(_optimize_unicode)
        ...
 }}}
 If I put it instead into the Python command called in builder.py, I get
 more information:
 {{{
          962034 function calls (948847 primitive calls) in 4.297 seconds
    Ordered by: internal time
    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     18537    1.142    0.000    1.142    0.000 {method 'read' of 'file'
 objects}
        64    0.199    0.003    2.480    0.039 all.py:1(<module>)
     23751    0.159    0.000    0.279    0.000
 intersphinx.py:90(split_lines)
 35847/35841    0.133    0.000    0.172    0.000 posixpath.py:60(join)
        57    0.112    0.002    0.571    0.010
 intersphinx.py:74(read_inventory_v2)
         1    0.081    0.081    2.803    2.803 all.py:38(<module>)
         2    0.079    0.039    0.079    0.040 {cPickle.load}
     29365    0.063    0.000    0.063    0.000 {_codecs.utf_8_decode}
  2269/568    0.057    0.000    0.163    0.000 sre_parse.py:379(_parse)
        17    0.053    0.003    2.075    0.122 all.py:3(<module>)
        ...
 }}}
 We're calling certain functions a huge number of times, but we're not
 importing sage.all (as far as I can tell). I don't know why we're calling
 posixpath.join 35000 times, for example: that seems like a lot. Could it
 be reading every file in the Sage library each time, instead of only the
 files referenced in that section?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14204#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to