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

ChameleonRedOne avatarChameleonRedOne 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.:

test_0_9_9
5.2156014242
test_0_9_10b1
7.3552937594

Comments (4)

  1. ChameleonRedOne

    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

    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

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.