This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Разное интересное по многопоточности: | |
// Featured-секция, для любителей архивной документации от Apple: | |
1. https://developer.apple.com/library/archive/technotes/tn/tn2028.html#//apple_ref/doc/uid/DTS10003065 - про внутренности потоков в MAC OS X в сравнении с MAC OS 9 | |
2. https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/About/About.html - Kernel Programming guide, вы же понимаете, что там будет, да :D | |
// Для любителей WWDC: | |
1. https://developer.apple.com/videos/play/wwdc2015/718/ - GCD раз. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene import relay, String, List | |
from graphene_django.filter import DjangoFilterConnectionField | |
from graphene_django.fields import DjangoConnectionField | |
from app.models import Model | |
class Object(DjangoObjectType): | |
class Meta: | |
model = Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gc | |
def queryset_iterator(queryset, chunksize=1000): | |
''''' | |
Iterate over a Django Queryset ordered by the primary key | |
This method loads a maximum of chunksize (default: 1000) rows in it's | |
memory at the same time while django normally would load all rows in it's | |
memory. Using the iterator() method only causes it to not preload all the | |
classes. |