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?