On May 25, 12:12 pm, "Diez B. Roggisch" <[email protected]> wrote:
>
> Then there is the question who's going to decide when it's ok to import what -
> via configuration?

Why do you need configuration at all? TurboGears should /know/ when
and why it needs a given package, shouldn't it?
As for my code, if I have to use tw, I just "import
tw.whatever_package".
If I have to use pygments, I just "import pygments".

> > Loading lots of modules has a real cost. Besides inflating memory
> > requirements (and potentially decreasing CPU caches/TLBs efficiency),
>
> Please, we are talking about python here, not hand-optimized LAPACK code.

Why do you think CPU caches are only useful for LAPACK code?
A Python program (code *and* data) is a big number of PyObjects
referencing each other. The interpreter is continuously chasing
pointers. When such an object is not in the CPU cache, you will suffer
the access latency of main memory.

> And
> resident modules loaded but not actively used do degrade CPU caches in exact
> what way?

For example, garbage collection periodically walks the list of all GC-
enabled objects. Which is quite a lot of them. And it's probably very
cache-unfriendly. Actually, I've given the numbers in a previous
message.
(loading a module creates dicts, tuples, and all kinds of other GC-
enabled structures. Even functions are GC-enabled objects)

> All of this without a compelling usecase for optimizing - sorry, but you won't
> get far with this anywhere unless you show a real impact for a real
> use-case - not some premature optimization guesswork.

A compelling use-case? Well, any Web application with some kind of
popularity would be a compelling use-case. Your objection is like
answering "there's no compelling usecase for optimizing" to someone
complaining that tg does 10 superfluous SQL requests for each page
request (I'm not saying it does that, it's just a hypothetical
situation).

--~--~---------~--~----~------------~-------~--~----~
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