<feed xmlns='http://www.w3.org/2005/Atom'>
<title>chango.git/tests/builtin_server, branch devmain</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/chango.git/atom?h=devmain</id>
<link rel='self' href='http://cgit.adnoto.dev/chango.git/atom?h=devmain'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/'/>
<updated>2023-01-05T18:26:56Z</updated>
<entry>
<title>Fixed #33865 -- Optimized LimitedStream wrapper.</title>
<updated>2023-01-05T18:26:56Z</updated>
<author>
<name>Nick Pope</name>
<email>nick@nickpope.me.uk</email>
</author>
<published>2022-07-22T20:08:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=b47f2f5b907732d80b164f1f361ae39da94a3fa6'/>
<id>urn:sha1:b47f2f5b907732d80b164f1f361ae39da94a3fa6</id>
<content type='text'>
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
  -&gt; [bench_limitedstream-patch] 227 ns +- 6 ns: 1.26x faster
LimitedStream.readline() (single line):
  Mean +- std dev: [bench_limitedstream-main] 507 ns +- 11 ns
  -&gt; [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
  -&gt; [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
  -&gt; [bench_limitedstream-patch] 305 ns +- 10 ns: 1.98x faster
LimitedStream.read() (multiple lines):
  Mean +- std dev: [bench_limitedstream-main] 290 ns +- 5 ns
  -&gt; [bench_limitedstream-patch] 236 ns +- 6 ns: 1.23x faster
LimitedStream.readline() (multiple lines):
  Mean +- std dev: [bench_limitedstream-main] 517 ns +- 19 ns
  -&gt; [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
  -&gt; [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
  -&gt; [bench_limitedstream-patch] 308 ns +- 7 ns: 1.95x faster

Geometric mean: 1.59x faster
</content>
</entry>
<entry>
<title>Refs #33476 -- Reformatted code with Black.</title>
<updated>2022-02-07T19:37:05Z</updated>
<author>
<name>django-bot</name>
<email>ops@djangoproject.com</email>
</author>
<published>2022-02-03T19:24:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=9c19aff7c7561e3a82978a272ecdaad40dda5c00'/>
<id>urn:sha1:9c19aff7c7561e3a82978a272ecdaad40dda5c00</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #29069 -- Added test for calling request_finished signal by static file responses.</title>
<updated>2020-04-20T04:17:57Z</updated>
<author>
<name>Tom Forbes</name>
<email>tom@tomforb.es</email>
</author>
<published>2020-04-18T20:59:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=141ab6bc6d93d3a91259896f6ea3b7485172df88'/>
<id>urn:sha1:141ab6bc6d93d3a91259896f6ea3b7485172df88</id>
<content type='text'>
Fixed in 41a3b3d18647b258331104520e76f977406c590d.
</content>
</entry>
<entry>
<title>Fixed #31240 -- Properly closed FileResponse when wsgi.file_wrapper is used.</title>
<updated>2020-02-11T19:39:12Z</updated>
<author>
<name>Florian Apolloner</name>
<email>florian@apolloner.eu</email>
</author>
<published>2020-02-07T11:55:59Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=41a3b3d18647b258331104520e76f977406c590d'/>
<id>urn:sha1:41a3b3d18647b258331104520e76f977406c590d</id>
<content type='text'>
Thanks to Oskar Persson for the report.
</content>
</entry>
<entry>
<title>Fixed typos in test names and a comment.</title>
<updated>2019-08-23T08:46:43Z</updated>
<author>
<name>Min ho Kim</name>
<email>minho42@gmail.com</email>
</author>
<published>2019-08-23T08:46:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=7bd963332017eace00be8caf7dc1b7b304da613a'/>
<id>urn:sha1:7bd963332017eace00be8caf7dc1b7b304da613a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #23919 -- Replaced super(ClassName, self) with super().</title>
<updated>2017-01-25T17:23:46Z</updated>
<author>
<name>chillaranand</name>
<email>anand21nanda@gmail.com</email>
</author>
<published>2017-01-21T13:13:44Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=d6eaf7c0183cd04b78f2a55e1d60bb7e59598310'/>
<id>urn:sha1:d6eaf7c0183cd04b78f2a55e1d60bb7e59598310</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #23919 -- Removed unneeded str() calls</title>
<updated>2017-01-20T13:13:55Z</updated>
<author>
<name>Claude Paroz</name>
<email>claude@2xlibre.net</email>
</author>
<published>2017-01-20T09:20:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=042b7350a080cc964f913faf1cf7f0097f650a58'/>
<id>urn:sha1:042b7350a080cc964f913faf1cf7f0097f650a58</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #23919 -- Stopped inheriting from object to define new style classes.</title>
<updated>2017-01-19T07:39:46Z</updated>
<author>
<name>Simon Charette</name>
<email>charettes@users.noreply.github.com</email>
</author>
<published>2017-01-19T07:39:46Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=cecc079168e8669138728d31611ff3a1e7eb3a9f'/>
<id>urn:sha1:cecc079168e8669138728d31611ff3a1e7eb3a9f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Refs #23919 -- Removed encoding preambles and future imports</title>
<updated>2017-01-18T08:55:19Z</updated>
<author>
<name>Claude Paroz</name>
<email>claude@2xlibre.net</email>
</author>
<published>2016-11-19T17:19:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=d7b9aaa366dd54ecc3142c588162e3adc7c2f7ac'/>
<id>urn:sha1:d7b9aaa366dd54ecc3142c588162e3adc7c2f7ac</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Removed a bit of builtin_server tests for Python ≤ 2.7.3.</title>
<updated>2016-11-11T03:20:09Z</updated>
<author>
<name>Tim Graham</name>
<email>timograham@gmail.com</email>
</author>
<published>2016-11-11T03:12:08Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/chango.git/commit/?id=7b05ffd95d2ab8c6653ce4efc49658efb79965c8'/>
<id>urn:sha1:7b05ffd95d2ab8c6653ce4efc49658efb79965c8</id>
<content type='text'>
</content>
</entry>
</feed>
