Ticket #8254: 8254-lazy-schemes-import.patch

File 8254-lazy-schemes-import.patch, 1.6 KB (added by robertwb, 9 years ago)

Shaves off about 0.3 seconds for me. Depends on #8456

  • sage/all.py

    # HG changeset patch
    # User Robert Bradshaw <robertwb@math.washington.edu>
    # Date 1267868560 28800
    # Node ID a857871da52a76cbf9ece10424f675a34364ce2b
    # Parent  babf51f884ebe218d644534d2803c75c68b61084
    #8254 - lazily import schemes for better startup time
    
    diff -r babf51f884eb -r a857871da52a sage/all.py
    a b  
    8080from sage.modules.all    import *
    8181from sage.monoids.all    import *
    8282from sage.algebras.all   import *
    83 from sage.modular.all    import *
    84 from sage.schemes.all    import *
     83lazy_import("sage.modular.all", "*", overwrite=False)
     84lazy_import("sage.schemes.all", "*", overwrite=False)
    8585from sage.graphs.all     import *
    8686from sage.groups.all     import *
    87 from sage.databases.all  import *
     87lazy_import("sage.databases.all", "*", overwrite=False)
    8888from sage.structure.all  import *
    8989from sage.categories.all import *
    9090from sage.sets.all       import *
     
    108108from sage.coding.all     import *
    109109from sage.combinat.all   import *
    110110
    111 from sage.lfunctions.all import *
     111lazy_import("sage.lfunctions.all", "*", overwrite=False)
    112112
    113113from sage.geometry.all   import *
    114114
     
    182182except:
    183183    pass
    184184
    185 # very useful 2-letter shortcuts
    186 CC = ComplexField()
    187 QQ = RationalField()
    188 RR = RealField()  # default real field
    189 ZZ = IntegerRing()
    190185# NOTE: QQ, RR, and ZZ are used by the pre-parser, and should not be
    191186# overwritten by the user, unless they want to change the meaning of
    192187# int and real in the interpreter (which is a potentially valid thing