Hi James,

Thank you for the input!

So my takeaway from what you are saying is that no one is running a
production site with a Django select field to render a country or currency
option (e.g., django-countries or django-money), because either of these
would have well over a hundred entries (and my form happens to have both).
Instead they would be loading these options via AJAX or using a different
widget all together like an auto-complete.  (I get it that a long list is
not the best UX but that's a bit of a different discussion).

It seems like a regression of this magnitude should be called out in the
Django documentation for the default rendering option?  I'm also surprised
neither of those mainstream libraries would mention something about this.
Adding 500+ms isn't in the realm of "tweaking" performance, for most
serious sites it would be a complete fail.  So I guess I'm just a little
skeptical that the real answer here is that I shouldn't expect this to work
anyway. I feel like this kind of change would have affected a lot of other
folks in similar significant fashion, which makes me think there is
something else going on (some other kind of boneheaded thing I may be
doing).

thanks,
John




On Mon, Dec 10, 2018 at 7:47 AM James Bennett <ubernost...@gmail.com> wrote:

> On Mon, Dec 10, 2018 at 5:31 AM John Lehmann <john.lehm...@gmail.com>
> wrote:
>
>> I am still hoping however for someone to explain to me why the default
>> renderer cannot handle my use case, such as that a few hundred inputs is
>> too many, or that I am doing something else improperly.  Surely this kind
>> of a change would not be made to the framework that would cause such an
>> unacceptable performance (500+ms added). Kind of disappointing to spend a
>> whole week upgrading only to end up wanting to downgrade again.
>>
>
> The Django template language is not really optimized for speed of
> rendering. Even with a caching loader, rendering a template hundreds of
> times will be an expensive enough operation to show up in your profiling.
>
> The solutions are to use something faster (Jinja) if you absolutely must
> be rendering hundreds of things, or find a way to make the form more
> efficient (generally, when a form has hundreds of options to display in a
> select, that's a sign of issues with the design of the form).
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/uhe7ExBJoxg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL13Cg9amLPan9-pj%2BHpHc7vns6_5EJcvNHvF0VPakf651%3DT1g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAL13Cg9amLPan9-pj%2BHpHc7vns6_5EJcvNHvF0VPakf651%3DT1g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANRc4UPMBqpOypDekUAsPbU9KLf0DL%2BAEghAZsJo30uUhyYXJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to