Ticket #10220: trac-10220-speedup.patch

File trac-10220-speedup.patch, 2.9 KB (added by jason, 3 years ago)
  • sage/groups/perm_gps/cubegroup.py

    # HG changeset patch
    # User Jason Grout <jason.grout@drake.edu>
    # Date 1288928205 18000
    # Node ID 7bd8ff0b77921209536d6766ee7d957807134171
    # Parent  120c07be6358d93bcff503363d379c26b8342f2b
    #10220: Make some imports local to improve Sage startup time
    
    diff -r 120c07be6358 -r 7bd8ff0b7792 sage/groups/perm_gps/cubegroup.py
    a b  
    107107from sage.rings.finite_rings.constructor import FiniteField as GF 
    108108from sage.rings.arith import factor 
    109109from sage.groups.abelian_gps.abelian_group import AbelianGroup 
    110 from sage.plot.all import polygon, text 
     110from sage.plot.polygon import polygon 
     111from sage.plot.text import text 
    111112pi = RDF.pi() 
    112113 
    113114 
    114 from sage.plot.plot3d.shapes import * 
     115from sage.plot.plot3d.shapes import Box 
    115116from sage.plot.plot3d.texture import Texture 
    116117 
    117118####################### predefined colors ################## 
  • sage/misc/sage_input.py

    diff -r 120c07be6358 -r 7bd8ff0b7792 sage/misc/sage_input.py
    a b  
    160160 
    161161""" 
    162162 
    163 from sage.misc.functional import parent 
    164163import math 
    165164 
    166165########################################################################## 
     
    446445        # However, we don't want to assume that hashing x is always 
    447446        # efficient, so we only try the lookup if some value of the same 
    448447        # type as x has been cached. 
     448        from sage.misc.functional import parent 
     449 
    449450        if type(x) in self._cached_types: 
    450451            v = self._cache.get((parent(x), x)) 
    451452            if v is not None: return v 
     
    655656            GF_101 = GF(101) 
    656657            GF_101(42) + GF_101(43) 
    657658        """ 
     659        from sage.misc.functional import parent 
     660         
    658661        self._cached_types.add(type(x)) 
    659662        self._cache[(parent(x), x)] = sie 
    660663        sie._sie_preferred_varname = name 
  • sage/misc/sage_timeit.py

    diff -r 120c07be6358 -r 7bd8ff0b7792 sage/misc/sage_timeit.py
    a b  
    99    -- William Stein, based on code by Fernando Perez included in IPython 
    1010""" 
    1111 
    12 import timeit as timeit_, time, math, preparser, interpreter 
    1312 
    1413class SageTimeitResult(): 
    1514    r""" 
     
    141140        True 
    142141 
    143142    """ 
     143    import timeit as timeit_, time, math, preparser, interpreter 
    144144    number=int(number) 
    145145    repeat=int(repeat) 
    146146    precision=int(precision) 
  • sage/plot/complex_plot.pyx

    diff -r 120c07be6358 -r 7bd8ff0b7792 sage/plot/complex_plot.pyx
    a b  
    2323include "../ext/interrupt.pxi" 
    2424 
    2525cimport numpy as cnumpy 
    26 import numpy 
    2726 
    2827from sage.plot.primitive import GraphicPrimitive 
    2928from sage.plot.misc import options