| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
HttpRequest and subclasses."
This reverts commit 6220c445c40a6a7f4d442de8bde2628346153963.
Thanks Adam Johnson and Márton Salomváry for reports.
|
|
|
|
| |
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
| |
|
|
|
|
|
| |
co-authored-by: kozzztik <kozzztik@mail.ru>
co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
|
|
|
|
| |
Thanks to Jakob Ackermann for the report.
|
| |
|
|
|
| |
Available since Python 3.10.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current implementation of LimitedStream is slow because .read()
performs an extra copy into a buffer and .readline() performs two
extra copies. The stream being wrapped is already typically a BytesIO
object so this is unnecessary.
This implementation has largely been untouched for 12 years and,
inspired by a simpler implementation in werkzeug, it was possible to
achieve the following performance improvement:
LimitedStream.read() (single line):
Mean +- std dev: [bench_limitedstream-main] 286 ns +- 6 ns
-> [bench_limitedstream-patch] 227 ns +- 6 ns: 1.26x faster
LimitedStream.readline() (single line):
Mean +- std dev: [bench_limitedstream-main] 507 ns +- 11 ns
-> [bench_limitedstream-patch] 232 ns +- 8 ns: 2.18x faster
LimitedStream.read(8192) (single line):
Mean +- std dev: [bench_limitedstream-main] 360 ns +- 8 ns
-> [bench_limitedstream-patch] 297 ns +- 6 ns: 1.21x faster
LimitedStream.readline(8192) (single line):
Mean +- std dev: [bench_limitedstream-main] 602 ns +- 10 ns
-> [bench_limitedstream-patch] 305 ns +- 10 ns: 1.98x faster
LimitedStream.read() (multiple lines):
Mean +- std dev: [bench_limitedstream-main] 290 ns +- 5 ns
-> [bench_limitedstream-patch] 236 ns +- 6 ns: 1.23x faster
LimitedStream.readline() (multiple lines):
Mean +- std dev: [bench_limitedstream-main] 517 ns +- 19 ns
-> [bench_limitedstream-patch] 239 ns +- 7 ns: 2.16x faster
LimitedStream.read(8192) (multiple lines):
Mean +- std dev: [bench_limitedstream-main] 363 ns +- 8 ns
-> [bench_limitedstream-patch] 311 ns +- 11 ns: 1.17x faster
LimitedStream.readline(8192) (multiple lines):
Mean +- std dev: [bench_limitedstream-main] 601 ns +- 12 ns
-> [bench_limitedstream-patch] 308 ns +- 7 ns: 1.95x faster
Geometric mean: 1.59x faster
|
|
|
|
|
| |
Thanks to Florian Vazelle for initial exploratory work, and to Nick
Pope and Mariusz Felisiak for review.
|
|
|
| |
Thanks to Mariusz Felisiak for review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Updated references to RFC 1123 to RFC 5322
- Only partial as RFC 5322 sort of sub-references RFC 1123.
- Updated references to RFC 2388 to RFC 7578
- Except RFC 2388 Section 5.3 which has no equivalent.
- Updated references to RFC 2396 to RFC 3986
- Updated references to RFC 2616 to RFC 9110
- Updated references to RFC 3066 to RFC 5646
- Updated references to RFC 7230 to RFC 9112
- Updated references to RFC 7231 to RFC 9110
- Updated references to RFC 7232 to RFC 9110
- Updated references to RFC 7234 to RFC 9111
- Tidied up style of text when referring to RFC documents
|
| |
|
| |
|
|
|
|
| |
Regression in 441103a04d1d167dc870eaaf90e3fba974f67c93.
|
|
|
|
| |
in ASGI handler on Python 3.11+.
|
| |
|
|
|
|
|
|
| |
middlewares.
It's the wrapped handler that's adapted to the wrapping middleware.
|
| |
|
| |
|
|
|
| |
Unused since its introduction in 269e921756371bee6d35a967bc2ffe84d1ae39eb.
|
|
|
|
|
|
| |
There's little point retrieving a fresh reference to the exception in
the legacy tuple format, when it's all available via the exception
instance we already have.
|
|
|
| |
This allows better debugging and filtering of errors.
|
| |
|
|
|
|
| |
appropriate.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By using a asgiref's ThreadSensitiveContext context manager, requests
will be able to execute independently of other requests when sync work
is involved.
Prior to this commit, a single global thread was used to execute any
sync work independent of the request from which that work was scheduled.
This could result in contention for the global sync thread in the case
of a slow sync function.
Requests are now isolated to their own sync thread.
|
|
|
|
|
|
|
|
|
| |
This check dates back to Python <2.5, before Python introduced
BaseException to prevent exactly unwarranted catching of SystemExit
(and others).
response_for_exception() is only called under `except Exception` or
`except Http404` so it's now impossible for a SystemExit instance to
reach the branch.
|
|
|
|
|
| |
marking as unused in an async context.
Thanks Hubert Bielenia for the report.
|
|
|
|
|
| |
Thread sensitive parameter is True by default from asgiref v3.3.0.
Added an explicit thread_sensitive=False to previously implicit uses.
|
|
|
|
| |
destroyed while request is processing.
|
|
|
| |
Unused since its introduction in ed114e15106192b22ebb78ef5bf5bce72b419d13.
|
|
|
|
|
|
|
| |
Async exception handling was raising an exception that was creating a
cycle in the exception chain (by re-raising an exception in
sync_to_async that was already being handled).
Thanks Chris Jerdonek for detailed analysis.
|
| |
|
|
|
|
| |
sensitive.
|
|
|
|
|
| |
This implements support for asynchronous views, asynchronous tests,
asynchronous middleware, and an asynchronous test client.
|
| |
|
|
|
|
| |
Thanks to Oskar Persson for the report.
|
| |
|
| |
|
|
|
|
| |
None is not valid for settings.FILE_UPLOAD_MAX_MEMORY_SIZE.
Always use SpooledTemporaryFile.
|
|
|
|
| |
wsgi.file_wrapper.
|
| |
|
|
|
|
|
| |
This adds an ASGI handler, asgi.py file for the default project layout,
a few async utilities and adds async-safety to many parts of Django.
|
| |
|
|
|
|
| |
Obsolete since 742ea51413b3aab07c6afbfd1d52c1908ffcb510.
|
|
|
|
|
|
| |
sender argument.
Inaccurate since 7d1b69dbe7f72ac04d2513f0468fe2146231b286.
|
|
|
|
| |
Unused since 7d1b69dbe7f72ac04d2513f0468fe2146231b286.
|
| |
|
|
|
| |
Co-authored-by: Ross Thorne <rmwthorne@googlemail.com>
|
| |
|