Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
dc8f95b6
Kaydet (Commit)
dc8f95b6
authored
Eyl 20, 2013
tarafından
evildmp
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20877 -- added a performance optimization guide
üst
4db2752e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
22 deletions
+19
-22
index.txt
docs/index.txt
+8
-0
utils.txt
docs/ref/utils.txt
+2
-2
cache.txt
docs/topics/cache.txt
+0
-16
optimization.txt
docs/topics/db/optimization.txt
+8
-4
index.txt
docs/topics/index.txt
+1
-0
performance.txt
docs/topics/performance.txt
+0
-0
No files found.
docs/index.txt
Dosyayı görüntüle @
dc8f95b6
...
@@ -233,6 +233,14 @@ regions:
...
@@ -233,6 +233,14 @@ regions:
* :doc:`"Local flavor" <topics/localflavor>`
* :doc:`"Local flavor" <topics/localflavor>`
* :doc:`Time zones </topics/i18n/timezones>`
* :doc:`Time zones </topics/i18n/timezones>`
Performance and optimization
============================
There are a variety of techniques and tools that can help get your code running
more efficiently - faster, and using fewer system resources.
* :doc:`Performance and optimization overview <topics/performance>`
Python compatibility
Python compatibility
====================
====================
...
...
docs/ref/utils.txt
Dosyayı görüntüle @
dc8f95b6
...
@@ -495,8 +495,8 @@ Atom1Feed
...
@@ -495,8 +495,8 @@ Atom1Feed
For cases like this, use the ``django.utils.functional.allow_lazy()``
For cases like this, use the ``django.utils.functional.allow_lazy()``
decorator. It modifies the function so that *if* it's called with a lazy
decorator. It modifies the function so that *if* it's called with a lazy
translation as
the first argument, the function evaluation is delayed until it
translation as
one of its arguments, the function evaluation is delayed
needs to be converted to a string.
until it
needs to be converted to a string.
For example::
For example::
...
...
docs/topics/cache.txt
Dosyayı görüntüle @
dc8f95b6
...
@@ -1162,22 +1162,6 @@ Example::
...
@@ -1162,22 +1162,6 @@ Example::
.. _`Cache-Control spec`: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
.. _`Cache-Control spec`: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
Other optimizations
===================
Django comes with a few other pieces of middleware that can help optimize your
site's performance:
* ``django.middleware.http.ConditionalGetMiddleware`` adds support for
modern browsers to conditionally GET responses based on the ``ETag``
and ``Last-Modified`` headers.
* :class:`django.middleware.gzip.GZipMiddleware` compresses responses for all
modern browsers, saving bandwidth and transfer time. Be warned, however,
that compression techniques like ``GZipMiddleware`` are subject to attacks.
See the warning in :class:`~django.middleware.gzip.GZipMiddleware` for
details.
Order of MIDDLEWARE_CLASSES
Order of MIDDLEWARE_CLASSES
===========================
===========================
...
...
docs/topics/db/optimization.txt
Dosyayı görüntüle @
dc8f95b6
...
@@ -88,7 +88,8 @@ of parentheses, but will call callables automatically, hiding the above
...
@@ -88,7 +88,8 @@ of parentheses, but will call callables automatically, hiding the above
distinction.
distinction.
Be careful with your own custom properties - it is up to you to implement
Be careful with your own custom properties - it is up to you to implement
caching.
caching when required, for example using the
:class:`~django.utils.functional.cached_property` decorator.
Use the ``with`` template tag
Use the ``with`` template tag
-----------------------------
-----------------------------
...
@@ -111,10 +112,11 @@ For instance:
...
@@ -111,10 +112,11 @@ For instance:
* At the most basic level, use :ref:`filter and exclude <queryset-api>` to do
* At the most basic level, use :ref:`filter and exclude <queryset-api>` to do
filtering in the database.
filtering in the database.
* Use :class:`F expressions <django.db.models.F>` to
do filtering
* Use :class:`F expressions <django.db.models.F>` to
filter
against
other fields within the same model.
based on
other fields within the same model.
* Use :doc:`annotate to do aggregation in the database </topics/db/aggregation>`.
* Use :doc:`annotate to do aggregation in the database
</topics/db/aggregation>`.
If these aren't enough to generate the SQL you need:
If these aren't enough to generate the SQL you need:
...
@@ -233,6 +235,8 @@ queryset``.
...
@@ -233,6 +235,8 @@ queryset``.
But:
But:
.. _overuse_of_count_and_exists:
Don't overuse ``count()`` and ``exists()``
Don't overuse ``count()`` and ``exists()``
------------------------------------------
------------------------------------------
...
...
docs/topics/index.txt
Dosyayı görüntüle @
dc8f95b6
...
@@ -26,6 +26,7 @@ Introductions to all the key parts of Django you'll need to know:
...
@@ -26,6 +26,7 @@ Introductions to all the key parts of Django you'll need to know:
pagination
pagination
python3
python3
security
security
performance
serialization
serialization
settings
settings
signals
signals
docs/topics/performance.txt
0 → 100644
Dosyayı görüntüle @
dc8f95b6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment