Re: GSoc : Templates Compilation , draft 2

2011-04-12 Thread Jonathan Slenders
Like Russ Magee said, Armin has a lot of experience in this field and
even if he didn't yet decided how to implement a compiled engine for
Django templates, I'm sure he will do a good job on this.

But that certainly doesn't mean that you shouldn't try as well (Even
when it's not accepted for GSoC). We'll see what the outcome is, and
the best one (in terms of stability and cleanness of the code.) can be
merged in Django. That's how open source works. For some stuff,
several people implement it, and the community gets the choice.

You learn damn a lot by writing a parser or compiler, but it can
sometimes take many times of refactoring and rewriting code before you
get a satisfying enough result.

By the way, someone in this group said that l10n takes a lot of time
during template rendering. I wonder what we can do about that...

Have a nice day,
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Using dimension_fields in models.ImageField cause performance penalties

2011-04-12 Thread Russell Keith-Magee
On Mon, Apr 11, 2011 at 8:16 PM, stan  wrote:
> The main purpose of the height_field and width_field attributes is to
> give a performance boost in some situations,
> these fields acting as a cache on the dimensions of the image.
...
> The simple fact of posting an unchanged form of a person cause the
> opening with the PIL of *all* the unmodified images to fill-in the
> dimension_fields of the virtual models in the form validation process.
>
> This looks like an unecessary overhead and maybe something more lazy
> could be more appropriate. I am sorry for not coming with a patch -  I
> do not get the whole picture of the core - but an expert point of
> views is welcome here :-)

It sounds to me like you could be right; this strikes me as an
oversight, rather than anything deliberate. It's worth opening a
ticket so that this isn't forgotten.

Although you're seeing the problem with FormSets, I suspect you'll
find that it exists with normal forms, too -- it just isn't as
pronounced because a formset multiplies the scope of the problem.

Looking at the code in question, the reference to #11084 is a good
starting point for further analysis. It describes the exact problem
that you're talking about under a slightly different context. I
suspect you'll find that the fix to your problem will be in a similar
mould -- i.e., find a set of conditions that accurately identifies
when a form is being instantiated with existing file data, and ensure
that the dimension update doesn't happen under those conditions.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.