Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize sage startup -- don't import twisted.web2 until needed #3568

Closed
williamstein opened this issue Jul 6, 2008 · 9 comments
Closed

Comments

@williamstein
Copy link
Contributor

BEFORE

teragon-2:databases was$ sage -startuptime |grep -i web2
           twisted.web2: 0.106 (twist)
            twisted.python: 0.004 (twisted.web2)
            twisted._version: 0.001 (twisted.web2)
            twisted.web2._version: 0.000 (twisted.web2)
            cgi: 0.004 (twisted.web2)
            twisted.internet: 0.011 (twisted.web2)
            twisted.persisted: 0.001 (twisted.web2)
            zope.interface.adapter: 0.001 (twisted.web2)
            calendar: 0.002 (twisted.web2)
            twisted.internet.defer: 0.000 (twisted.web2)
            twisted.internet.interfaces: 0.000 (twisted.web2)
             twisted.web2.stream: 0.000 (OpenSSL)
             twisted.web2.filter.range: 0.001 (OpenSSL)
             twisted.web2.responsecode: 0.000 (OpenSSL)
             twisted.web2.channel.cgi: 0.001 (OpenSSL)
             twisted.web2.channel.scgi: 0.000 (OpenSSL)
              twisted.web2.channel: 0.000 (twisted.web2.channel.scgi)
             twisted.web2.channel.http: 0.002 (OpenSSL)
             twisted.web2.channel.fastcgi: 0.000 (OpenSSL)
0.106 twisted.web2 (twist)

This is on os x with disk caching.

Component: notebook

Issue created by migration from https://trac.sagemath.org/ticket/3568

@williamstein
Copy link
Contributor Author

comment:1

AFTER (also, apply #3560):

teragon-2:notebook was$ sage -startuptime |grep web2
teragon-2:notebook was$ 

And if you apply #3560 maybe something like this:

teragon-2:notebook was$ sage -startuptime |grep notebook
      notebook.all: 0.005 (sage.server.all)
       notebook_object: 0.003 (notebook.all)
        run_notebook: 0.002 (notebook_object)
         getpass: 0.001 (run_notebook)
       sagetex: 0.000 (notebook.all)
       interact: 0.002 (notebook.all)

@williamstein
Copy link
Contributor Author

Attachment: sage-3568.patch.gz

@mwhansen
Copy link
Contributor

mwhansen commented Jul 6, 2008

comment:3

+1

@williamstein
Copy link
Contributor Author

comment:4

This got a positive review (see above).

Actually this breaks all the new doctests in worksheet.py that assume that that server.notebook
has been imported. The fix will be to write a function that imports sage.server.notebook and
makes a sample notebook; this will be even cleaner actually. I'll attach this soon.

@williamstein williamstein changed the title optimize sage startup -- don't import twisted.web2 until needed [not ready for review] optimize sage startup -- don't import twisted.web2 until needed Jul 6, 2008
@williamstein
Copy link
Contributor Author

comment:5

Attachment: sage-3568-part2.patch.gz

@williamstein williamstein changed the title [not ready for review] optimize sage startup -- don't import twisted.web2 until needed [with patch; needs review (again)] optimize sage startup -- don't import twisted.web2 until needed Jul 6, 2008
@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Aug 10, 2008

@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Aug 10, 2008

comment:6

I had some doctest problems with 3.0.6, due to not importing a module, that are now fixed.

Apply only 3568-was-notebook-startup-and-test-object.patch}.

All credit to was.

@ncalexan ncalexan mannequin changed the title [with patch; needs review (again)] optimize sage startup -- don't import twisted.web2 until needed optimize sage startup -- don't import twisted.web2 until needed Aug 10, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Aug 11, 2008

comment:7

For some reason this patch causes massive doctest failures:

        sage -t -long devel/sage/sage/server/notebook/cell.py # 1 doctests failed
        sage -t -long devel/sage/sage/rings/real_double.pyx # 0 doctests failed
        sage -t -long devel/sage/sage/misc/session.pyx # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/weight_space.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_reducible.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_dual.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_G.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_F.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_E.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/type_A.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/root_space.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/ambient_space.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/dynkin_diagram.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/root_system.py # 3 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/cartan_type.py # 2 doctests failed
        sage -t -long devel/sage/sage/combinat/crystals/tensor_product.py # 4 doctests failed
        sage -t -long devel/sage/sage/combinat/crystals/spins.py # 2 doctests failed
        sage -t -long devel/sage/sage/combinat/crystals/letters.py # 1 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/weyl_group.py # 2 doctests failed
        sage -t -long devel/sage/sage/combinat/root_system/weyl_characters.py # 4 doctests failed

Cheers,

Michael

@mwhansen
Copy link
Contributor

comment:8

This is a dupe of #4671 which has been merged.

@mwhansen mwhansen removed this from the sage-3.4.1 milestone Jan 19, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants