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": > > > I'm not sure why all of > PIL, to serve generated images
> genshi, the default > mako, because it's used by some components (WebError I believe uses it by default) > tempita, For paster templates to work, not entirely sure why it's loaded at runtime > pygments (!), the weberror > whole paste and because it's the foundation of pylons > tw.core subhierarchies, because you use widgets (for example the admin) > among others, have to be xml.* is used by genshi > loaded like that. > by the way in the tg2.1 branch most of the peak.* stuff is gone. And again I use django as an example, you will load to memory all the equivalents of the above plus the admin, plus the geospatial library code, plus whatever else the decide to put into their monolitic package. But as Diez is saying. what is the point of the discussion? This is how python works if it's mention in a .py it goes to memory. But it's a startup cost vrs a long running cost. Your system will take a minute or two to boot with twice as many dependencies. Yet you have a very fast response time. This is exactly why running python under CGI is such a bad idea. Because modern frameworks are big in size as they assume RAM is abundant (it's very cheap now) which means you can have a bigger memory foot print and gain a lot of development time and long term gain. As for your other arguments about the memory you are mistaken. The Proces will stay at 20-30MB, it will never garbage collect these modules, they are "persistent" memory, the only part of your memory that will change is that of the request and the thread-local objects. > Regards > > Antoine. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

