These are chat archives for django/django

22nd
Aug 2016
Tai Lee
@mrmachine
Aug 22 2016 06:57
why does django take a long time to save an uploaded 1GB file? testing locally it takes a few seconds (~15) to upload the file but then django times out after a minute (gunicorn timeout set to 60s)... django just has to save the file, not do anything to it...
Dmitry Fedotkin
@BlackPie
Aug 22 2016 15:20
Hi everyone!
Can anyone help me with a code optimization? I am profiling my script and stucked with a three lines https://gist.github.com/BlackPie/c8887b201919f1f436252de0a5ba0e6e
1) If the list was created befory, why does iteration through that list take so much time?
2) records is OneToOneField; According to Django documentation select_related can help there, but it makes the execution time even longer! Why?
3) all the code wrapped in 'with transaction.atomic():' takes same time as the code without that statement, why?
THanks!
Ramon Moraes
@vyscond
Aug 22 2016 18:56
Why do you need enumerate?
Dmitry Fedotkin
@BlackPie
Aug 22 2016 20:12
Just for progress output. I profiled the code without that and it turned out that it doesnt affect significantly