Doctests that ensure that certain modules are not imported upon startup are 
also fine with me. 

In any case, here is another data point. Interestingly, os.path.join is 
about as fast as posix.lstat. I'd take that as another piece of evidence 
that filesystem caches are incredibly well optimized.

[vbraun@laptop ~]$ sage -ipython
Python 2.7.3 (default, Aug  2 2012, 12:23:48) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import gc

In [2]: gc.disable()

In [3]: %prun from sage.all import *

         186078 function calls (180912 primitive calls) in 0.584 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
       60    0.044    0.001    0.551    0.009 all.py:1(<module>)
        1    0.019    0.019    0.020    0.020 matrix_space.py:25(<module>)
        1    0.019    0.019    0.585    0.585 all.py:20(<module>)
       18    0.014    0.001    0.301    0.017 all.py:3(<module>)
      107    0.011    0.000    0.215    0.002 __init__.py:1(<module>)
     3046    0.010    0.000    0.014    0.000 posixpath.py:60(join)
        1    0.009    0.009    0.066    0.066 functional.py:13(<module>)
      164    0.008    0.000    0.008    0.000 
dynamic_class.py:259(dynamic_class_internal)
  413/135    0.008    0.000    0.021    0.000 sre_parse.py:379(_parse)
        2    0.006    0.003    0.014    0.007 all.py:7(<module>)
  501/500    0.005    0.000    0.010    0.000 
sageinspect.py:917(sage_getargspec)
     5908    0.005    0.000    0.006    0.000 sre_parse.py:182(__next)
  738/133    0.005    0.000    0.014    0.000 sre_compile.py:32(_compile)
     2206    0.005    0.000    0.005    0.000 {posix.lstat}
        1    0.004    0.004    0.010    0.010 interface.py:22(<module>)
  546/195    0.004    0.000    0.016    0.000 lazy_attribute.py:506(__get__)
      238    0.004    0.000    0.006    0.000 
sre_compile.py:207(_optimize_charset)
  265/256    0.004    0.000    0.027    0.000 posixpath.py:355(realpath)
        1    0.004    0.004    0.011    0.011 infinity.py:191(<module>)
        1    0.004    0.004    0.004    0.004 
ell_modular_symbols.py:37(<module>)
        3    0.004    0.001    0.011    0.004 
polynomial_ring_constructor.py:507(_multi_variate)
        3    0.004    0.001    0.006    0.002 sequence.py:86(Sequence)
        2    0.003    0.002    0.007    0.003 all.py:4(<module>)
        1    0.003    0.003    0.047    0.047 cone.py:185(<module>)
 1029/432    0.003    0.000    0.004    0.000 sre_parse.py:140(getwidth)
     8686    0.003    0.000    0.003    0.000 {isinstance}
      282    0.003    0.000    0.003    0.000 {dir}
      815    0.003    0.000    0.003    0.000 {posix.stat}
    15703    0.003    0.000    0.003    0.000 {method 'startswith' of 'str' 
objects}
        1    0.003    0.003    0.006    0.006 number_field.py:70(<module>)
      621    0.003    0.000    0.003    0.000 {open}
        2    0.003    0.001    0.017    0.009 __init__.py:9(<module>)
        1    0.003    0.003    0.005    0.005 cubegroup.py:85(<module>)
        1    0.003    0.003    0.003    0.003 
padic_extension_leaves.py:10(<module>)
    16444    0.003    0.000    0.003    0.000 {method 'endswith' of 'str' 
objects}
      142    0.002    0.000    0.007    0.000 homset.py:296(__init__)
      178    0.002    0.000    0.015    0.000 
pkg_resources.py:1687(find_on_path)
      575    0.002    0.000    0.011    0.000 __init__.py:84(open_resource)
        1    0.002    0.002    0.014    0.014 constructor.py:137(<module>)
       25    0.002    0.000    0.002    0.000 {posix.listdir}
        1    0.002    0.002    0.002    0.002 paths.py:165(<module>)
   115/93    0.002    0.000    0.003    0.000 
complex_interval_field.py:261(__call__)
      500    0.002    0.000    0.003    0.000 inspect.py:743(getargs)
        1    0.002    0.002    0.005    0.005 ambient.py:56(<module>)
     2206    0.002    0.000    0.008    0.000 posixpath.py:130(islink)
        1    0.002    0.002    0.008    0.008 support.py:9(<module>)
        1    0.002    0.002    0.002    0.002 
sloane_functions.py:67(<module>)
     5132    0.002    0.000    0.007    0.000 sre_parse.py:201(get)
   100/98    0.002    0.000    0.040    0.000 homset.py:40(Hom)
        1    0.002    0.002    0.025    0.025 digraph.py:91(<module>)
        6    0.002    0.000    0.185    0.031 all.py:2(<module>)

-- 
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org



Reply via email to