Hey,

Nice to see most of the performance differences are resolved. Most of the 
heavy lifting will actually be compiling the SQL that is going to be 
executed now I think. You might want to take a look at generating the SQL 
yourself and executing directly with connection.cursor if you're still 
hitting critical performance bottlenecks. If you do go down this route 
please make sure you're testing before and after, because the results could 
change significantly.

I'm also going to take your suggestion about the inner if condition and see 
how that impacts performance. I'll report back here for those curious, and 
open a PR if it makes any noticeable difference.

Thanks for looking into this and showing your results too, very helpful!

On Tuesday, 17 November 2015 11:36:37 UTC+11, Cristiano Coelho wrote:
>
> You beat me to it. Yes I have just tested under django 1.8.6, and the 
> issue I started this with is gone, both values_list and a direct raw query 
> perform as good, so this is definetly an issue only on django 1.7.10 or 
> less.
> I can not test django 1.9 since my project is not really compatible with 
> it, I have some backwards compatibility issues from 1.7.10 related to app 
> loading that I was very lazy to fix so I stood with 1.7, but it seems like 
> this will be time to update, assuming 1.9 will be as good as 1.8.
>
> Sorry about all the fuzz, I guess I should have tested all this directly 
> to 1.8 before making any post, but I apreciate the fast responses!
> Perhaps it would be a good idea to warn about values_list bottleneck on 
> 1.7!
>
>
> El lunes, 16 de noviembre de 2015, 21:30:35 (UTC-3), Josh Smeaton escribió:
>>
>> The version of Django you use is going to have a large (code) impact on 
>> what is actually happening when calling values_list. The 
>> Values[List]QuerySet classes are gone in 1.9. 1.8 implemented a 
>> different/better way of converting values from the database to python. 
>> from_db_value came about in 1.8 I think which should fast path a lot of 
>> conversions. The stackoverflow post you linked to mentions Django 1.7. Can 
>> you run exactly the same tests using Django Master/1.9 and report back your 
>> findings? 
>>
>> I don't doubt there's room for performance improvements if you go 
>> looking. As Anssi said, we'd definitely welcome improvements to performance 
>> where they can be found. But you should make sure the kinds of changes you 
>> want to make will have an impact when using the latest version of Django, 
>> because some of the low hanging fruit may have already been patched.
>>
>> Cheers
>>
>> On Tuesday, 17 November 2015 04:12:11 UTC+11, Cristiano Coelho wrote:
>>>
>>> Interesting, maybe because I'm using MySQL with mysqlclient connector, 
>>> but running the straight query with the django cursor wrapper always 
>>> returns the correct data types, even dates with its it time zone when time 
>>> zone is enabled, was it all coincidence? Would using a different backend 
>>> break with a cursor query returning invalid/not expected data? Seems like a 
>>> lot to test
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/f810c07c-ece5-4095-bde9-63cd20a82f82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to