Turn of the debugger, or remove weberror and you'll drop pygments, and
others.   Looks like Pylons expects Mako and TG expects genshi, I
don't actually see PIL in the list, tw is used for forms stuff and is
automatically loaded.   There are reasons for all these things, but we
can do better at not loading stuff that you don't use.

2.0.1 will let you set use_toscawidgets to False, and drop out the
whole TW thing.   Jinja and Mako are only loaded by TG when you
configure them in, but I'd guess that pylons or some other dependency
loads mako, and we can look into why that happens.

But in reality these are not taking up that much memory, and you're
looking at a very similar memory footprint to Django and Rails, so
while we'd gladly accept help in reducing it further, it's not a
primary development goal at the moment.

There are a lot of other things that would make it scale with less
memory better in normal situations.   In particular being totally
threadsafe makes it easier to scale up with less memory, and
TurboGears has been threadsafe since day one, while it's something
that Rails and Django have both achieved in the last year or so.   And
Django still does not claim that it's threadsafe, just that people are
using it in multithreaded setups ;)


--Mark Ramm

On Mon, May 25, 2009 at 5:20 AM, Antoine Pitrou
<[email protected]> wrote:
>
> On May 25, 2:53 am, Jorge Vargas <[email protected]> wrote:
>> Now here is the fun fact. I'm sure TG+ all it's dependencies is many
>> more LOC than django, someone should count those.
>
> First, let me say I'm sorry for my original bogus reasoning about
> mod_wsgi's daemon mode.
>
> In any case, besides the LOC count, there seems to be another issue
> which is the unconditional loading of all dependencies. Here is the
> list of loaded modules (taken from sys.modules) after a simple "import
> tg":
>
> - ConfigParser
> - Cookie
> - FixTk
> - HTMLParser
> - Image
> - ImageColor
> - ImageDraw
> - ImageFont
> - ImageMode
> - ImagePalette
> - SocketServer
> - StringIO
> - UserDict
> - __builtin__
> - __future__
> - __main__
> - _abcoll
> - _ast
> - _bisect
> - _bsddb
> - _codecs
> - _collections
> - _functools
> - _hashlib
> - _heapq
> - _imaging
> - _json
> - _locale
> - _random
> - _socket
> - _sre
> - _ssl
> - _struct
> - _warnings
> - _weakref
> - _xmlplus
> - abc
> - anydbm
> - array
> - atexit
> - base64
> - bdb
> - beaker
> - beaker.cache
> - beaker.container
> - beaker.converters
> - beaker.exceptions
> - beaker.ext
> - beaker.ext.database
> - beaker.ext.sqla
> - beaker.middleware
> - beaker.session
> - beaker.synchronization
> - beaker.util
> - binascii
> - bisect
> - bsddb
> - bsddb.db
> - bsddb.dbutils
> - cPickle
> - cStringIO
> - calendar
> - cgi
> - cmd
> - codecs
> - collections
> - commands
> - compiler
> - compiler.ast
> - compiler.consts
> - compiler.future
> - compiler.misc
> - compiler.pyassem
> - compiler.pycodegen
> - compiler.symbols
> - compiler.syntax
> - compiler.transformer
> - compiler.visitor
> - copy
> - copy_reg
> - datetime
> - dbhash
> - dbm
> - decimal
> - decorator
> - dis
> - distutils
> - distutils.dep_util
> - distutils.errors
> - distutils.log
> - distutils.spawn
> - distutils.util
> - dumbdbm
> - email
> - email._parseaddr
> - email.base64mime
> - email.base64mime
> - email.charset
> - email.charset
> - email.encoders
> - email.encoders
> - email.errors
> - email.errors
> - email.feedparser
> - email.generator
> - email.header
> - email.iterators
> - email.iterators
> - email.message
> - email.message
> - email.mime
> - email.mime.audio
> - email.mime.base
> - email.mime.base
> - email.mime.image
> - email.mime.message
> - email.mime.multipart
> - email.mime.multipart
> - email.mime.nonmultipart
> - email.mime.nonmultipart
> - email.mime.text
> - email.mime.text
> - email.parser
> - email.quoprimime
> - email.quoprimime
> - email.utils
> - email.utils
> - encodings
> - encodings.aliases
> - encodings.hex_codec
> - encodings.latin_1
> - encodings.utf_8
> - errno
> - exceptions
> - fcntl
> - fnmatch
> - formencode
> - formencode.api
> - formencode.compound
> - formencode.declarative
> - formencode.fieldstorage
> - formencode.foreach
> - formencode.htmlfill
> - formencode.interfaces
> - formencode.rewritingparser
> - formencode.schema
> - formencode.validators
> - formencode.variabledecode
> - functools
> - gc
> - gdbm
> - genericpath
> - genshi
> - genshi._speedups
> - genshi.builder
> - genshi.core
> - genshi.filters
> - genshi.filters.html
> - genshi.filters.i18n
> - genshi.filters.transform
> - genshi.input
> - genshi.output
> - genshi.path
> - genshi.template
> - genshi.template.base
> - genshi.template.directives
> - genshi.template.eval
> - genshi.template.interpolation
> - genshi.template.loader
> - genshi.template.markup
> - genshi.template.plugin
> - genshi.template.text
> - genshi.util
> - getpass
> - gettext
> - grp
> - hashlib
> - heapq
> - hmac
> - htmlentitydefs
> - httplib
> - imp
> - inspect
> - itertools
> - json
> - json.decoder
> - json.encoder
> - json.scanner
> - keyword
> - linecache
> - locale
> - logging
> - logging.config
> - logging.handlers
> - mako
> - mako._ast_util
> - mako.ast
> - mako.codegen
> - mako.exceptions
> - mako.ext
> - mako.ext.turbogears
> - mako.filters
> - mako.lexer
> - mako.lookup
> - mako.parsetree
> - mako.pygen
> - mako.pyparser
> - mako.runtime
> - mako.template
> - mako.util
> - markupbase
> - marshal
> - math
> - mimetools
> - mimetypes
> - modulefinder
> - new
> - opcode
> - operator
> - optparse
> - os
> - parser
> - paste
> - paste.cascade
> - paste.config
> - paste.deploy
> - paste.deploy.config
> - paste.deploy.converters
> - paste.deploy.loadwsgi
> - paste.deploy.util
> - paste.deploy.util.fixtypeerror
> - paste.deploy.util.threadinglocal
> - paste.errordocument
> - paste.fileapp
> - paste.httpexceptions
> - paste.httpheaders
> - paste.recursive
> - paste.registry
> - paste.request
> - paste.response
> - paste.script
> - paste.script.appinstall
> - paste.script.bool_optparse
> - paste.script.command
> - paste.script.copydir
> - paste.script.pluginlib
> - paste.script.templates
> - paste.script.util
> - paste.script.util.secret
> - paste.script.util.uuid
> - paste.urlparser
> - paste.util
> - paste.util.converters
> - paste.util.import_string
> - paste.util.looper
> - paste.util.mimeparse
> - paste.util.multidict
> - paste.util.quoting
> - paste.util.template
> - paste.util.threadinglocal
> - paste.wsgilib
> - pdb
> - peak
> - peak.rules
> - peak.rules.ast_builder
> - peak.rules.codegen
> - peak.rules.core
> - peak.rules.criteria
> - peak.rules.indexing
> - peak.rules.predicates
> - peak.util
> - peak.util.addons
> - peak.util.assembler
> - peak.util.decorators
> - peak.util.extremes
> - peak.util.symbols
> - pickle
> - pkg_resources
> - pkgutil
> - posix
> - posixpath
> - pprint
> - prioritized_methods
> - pwd
> - pyexpat.errors
> - pyexpat.model
> - pygments
> - pygments.console
> - pygments.filter
> - pygments.filters
> - pygments.formatter
> - pygments.formatters
> - pygments.formatters._mapping
> - pygments.formatters.bbcode
> - pygments.formatters.html
> - pygments.formatters.img
> - pygments.formatters.latex
> - pygments.formatters.other
> - pygments.formatters.rtf
> - pygments.formatters.svg
> - pygments.formatters.terminal
> - pygments.formatters.terminal256
> - pygments.lexer
> - pygments.lexers
> - pygments.lexers._mapping
> - pygments.lexers.agile
> - pygments.lexers.functional
> - pygments.lexers.special
> - pygments.plugin
> - pygments.style
> - pygments.styles
> - pygments.styles.default
> - pygments.token
> - pygments.unistring
> - pygments.util
> - pylons
> - pylons.config
> - pylons.configuration
> - pylons.controllers
> - pylons.controllers.core
> - pylons.controllers.util
> - pylons.controllers.xmlrpc
> - pylons.decorators
> - pylons.decorators.util
> - pylons.error
> - pylons.i18n
> - pylons.i18n.translation
> - pylons.legacy
> - pylons.middleware
> - pylons.templating
> - pylons.util
> - pylons.wsgiapp
> - quopri
> - random
> - re
> - readline
> - repoze
> - repoze.what
> - repoze.what.plugins
> - repoze.what.plugins.pylonshq
> - repoze.what.plugins.pylonshq.protectors
> - repoze.what.plugins.pylonshq.utils
> - repoze.what.predicates
> - repoze.who
> - repoze.who.plugins
> - repr
> - rfc822
> - routes
> - routes.base
> - routes.mapper
> - routes.middleware
> - routes.route
> - routes.threadinglocal
> - routes.util
> - select
> - sets
> - sgmlop
> - shutil
> - signal
> - simplejson
> - simplejson._speedups
> - simplejson.decoder
> - simplejson.encoder
> - simplejson.scanner
> - site
> - smtplib
> - socket
> - sqlalchemy
> - sqlalchemy.databases
> - sqlalchemy.engine
> - sqlalchemy.engine.base
> - sqlalchemy.engine.strategies
> - sqlalchemy.engine.threadlocal
> - sqlalchemy.engine.url
> - sqlalchemy.exc
> - sqlalchemy.ext
> - sqlalchemy.log
> - sqlalchemy.pool
> - sqlalchemy.queue
> - sqlalchemy.schema
> - sqlalchemy.sql
> - sqlalchemy.sql.expression
> - sqlalchemy.sql.operators
> - sqlalchemy.sql.visitors
> - sqlalchemy.types
> - sqlalchemy.util
> - sre_compile
> - sre_constants
> - sre_parse
> - ssl
> - stat
> - string
> - strop
> - struct
> - subprocess
> - symbol
> - sys
> - tarfile
> - tempfile
> - tempita
> - tempita._looper
> - termios
> - textwrap
> - tg
> - tg.configuration
> - tg.controllers
> - tg.decorators
> - tg.error
> - tg.exceptions
> - tg.flash
> - tg.i18n
> - tg.release
> - tg.render
> - tg.util
> - tg.wsgiapp
> - thread
> - threading
> - time
> - token
> - tokenize
> - traceback
> - turbojson
> - turbojson.jsonify
> - turbojson.jsonsupport
> - tw
> - tw.api
> - tw.core
> - tw.core.base
> - tw.core.engine_plugin
> - tw.core.exceptions
> - tw.core.js
> - tw.core.meta
> - tw.core.middleware
> - tw.core.registry
> - tw.core.resource_injector
> - tw.core.resources
> - tw.core.util
> - tw.core.view
> - tw.mods
> - tw.mods.base
> - types
> - urllib
> - urllib2
> - urlparse
> - uu
> - warnings
> - weakref
> - weberror
> - weberror.collector
> - weberror.errormiddleware
> - weberror.evalcontext
> - weberror.evalexception
> - weberror.formatter
> - weberror.reporter
> - weberror.util
> - weberror.util.escaping
> - weberror.util.serial_number_generator
> - weberror.util.source_encoding
> - webflash
> - webhelpers
> - webhelpers.html
> - webhelpers.html.builder
> - webhelpers.mimehelper
> - webhelpers.paginate
> - webhelpers.util
> - webob
> - webob.acceptparse
> - webob.byterange
> - webob.cachecontrol
> - webob.datastruct
> - webob.etag
> - webob.exc
> - webob.headerdict
> - webob.multidict
> - webob.statusreasons
> - webob.updatedict
> - webob.util
> - webob.util.dictmixin
> - xml.FtCore
> - xml.dom
> - xml.dom.DOMImplementation
> - xml.dom.MessageSource
> - xml.dom.NodeFilter
> - xml.dom.Range
> - xml.dom.domreg
> - xml.dom.html
> - xml.dom.html.HTMLDOMImplementation
> - xml.dom.minicompat
> - xml.dom.minidom
> - xml.dom.xmlbuilder
> - xml.parsers
> - xml.parsers.expat
> - xml.parsers.pyexpat
> - xml.sax
> - xml.sax._exceptions
> - xml.sax.handler
> - xml.sax.sax2exts
> - xml.sax.saxexts
> - xml.sax.saxlib
> - xml.sax.saxutils
> - xml.sax.xmlreader
> - xmlrpclib
> - zipfile
> - zipimport
> - zlib
> - zope
>
> I'm not sure why all of PIL, genshi, mako, tempita, pygments (!), the
> whole paste and tw.core subhierarchies, among others, have to be
> loaded like that.
>
> Regards
>
> Antoine.
>
> >
>



-- 
Mark Ramm-Christensen
email: mark at compoundthinking dot com
blog: www.compoundthinking.com/blog

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to