1. cthedot
  2. cssutils
Issue #18 wontfix

Version 0_9_10b1 loading time is about 50% slower than 0_9_9

ChameleonRedOne
created an issue

I was tested cssutils load time to use it in web application but it become slower see results and not usable in GAE i.e.:

{{{

!text

test_0_9_9 5.2156014242 test_0_9_10b1 7.3552937594 }}}

Comments (4)

  1. ChameleonRedOne reporter

    I could share some classes to speed up your library by lazy load if you want implement it on attribution license (it will require put my name in cssutlis and delivered deeds - no other restrictions). It will speed up you library.

    Testing code:

    import sys, os, inspect
    
    def cleanImports(zero):
      # delete loaded modules
      changed = set(sys.modules.keys())
      for mod in changed - zero:
        del sys.modules[mod]
    
    def test_0_9_9():
      # save current modules
      zero = set(sys.modules.keys())
    
      # test new
      sys.path.append('cssutils_0_9_9')
      from cssutils_0_9_9 import cssutils
    
      # delete loaded modules
      cleanImports(zero)
    
    def test_0_9_10b1():
      # save current modules
      zero = set(sys.modules.keys())
    
      # test new
      sys.path.append('cssutils_0_9_10b1')
      from cssutils_0_9_10b1 import cssutils
    
      # delete loaded modules
      cleanImports(zero)
    	
    from timeit import Timer
    
    repeats = 5
    
    t = Timer('test_0_9_9()', '''from __main__ import test_0_9_9, cleanImports
    print "test_0_9_9"''')
    print t.timeit(repeats)
    
    t = Timer('test_0_9_10b1()', '''from __main__ import test_0_9_10b1, cleanImports
    print "test_0_9_10b1"''')
    print t.timeit(repeats)
    
  2. cthedot repo owner

    would be great. I normally put names of contributing devs in the readme anyway, anywhere else where this should be stated? Maybe if you make a fork and I pull it from there? Thanks!

  3. cthedot repo owner

    sadly have no time to look into and without input will simply close this ticket. New release coming soon, might be better anyway but not so sure really.

  4. Log in to comment