Opened 13 years ago

Closed 12 years ago

#3568 closed enhancement (duplicate)

[with patch, needs work] optimize sage startup -- don't import twisted.web2 until needed

Reported by: was Owned by: boothby
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: notebook Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

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.

Attachments (3)

sage-3568.patch (1.8 KB) - added by was 13 years ago.
sage-3568-part2.patch (6.8 KB) - added by was 13 years ago.
3568-was-notebook-startup-and-test-object.patch (11.2 KB) - added by ncalexan 13 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 13 years ago by was

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)

Changed 13 years ago by was

comment:2 Changed 13 years ago by was

  • Summary changed from optimize sage startup -- don't import twisted.web2 until needed to [with patch; needs review] optimize sage startup -- don't import twisted.web2 until needed

comment:3 Changed 13 years ago by mhansen

  • Summary changed from [with patch; needs review] optimize sage startup -- don't import twisted.web2 until needed to [with patch; positive review] optimize sage startup -- don't import twisted.web2 until needed

+1

comment:4 Changed 13 years ago by was

  • Summary changed from [with patch; positive review] optimize sage startup -- don't import twisted.web2 until needed to [with patch; not ready for review] optimize sage startup -- don't import twisted.web2 until needed

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.

Changed 13 years ago by was

comment:5 Changed 13 years ago by was

  • Summary changed from [with patch; not ready for review] optimize sage startup -- don't import twisted.web2 until needed to [with patch; needs review (again)] optimize sage startup -- don't import twisted.web2 until needed

comment:6 Changed 13 years ago by ncalexan

  • Summary changed from [with patch; needs review (again)] optimize sage startup -- don't import twisted.web2 until needed to [with patch, with positive review] optimize sage startup -- don't import twisted.web2 until needed

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.

comment:7 Changed 13 years ago by mabshoff

  • Summary changed from [with patch, with positive review] optimize sage startup -- don't import twisted.web2 until needed to [with patch, needs work] optimize sage startup -- don't import twisted.web2 until needed

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

comment:8 Changed 12 years ago by mhansen

  • Milestone changed from sage-3.4.1 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.