From 43f8d7e2c592bfd33c836c734dc39a57cb9a040d Mon Sep 17 00:00:00 2001 From: taras Date: Wed, 11 Sep 2024 18:16:02 +0200 Subject: [PATCH] Bump version --- HISTORY.rst | 4 ++++ picows/__init__.py | 2 +- picows/picows.pyx | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0229878..fc1c5eb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,6 +5,10 @@ picows Release History :depth: 1 :local: +1.2.1 (2024-09-11) +------------------ + +* Optimization: Internal memory buffers were calling PyMem_Realloc too often 1.2.0 (2024-09-05) ------------------ diff --git a/picows/__init__.py b/picows/__init__.py index 29ea2bb..8b8b620 100644 --- a/picows/__init__.py +++ b/picows/__init__.py @@ -25,5 +25,5 @@ 'PICOWS_DEBUG_LL' ] -__version__ = "1.2.0" +__version__ = "1.2.1" __author__ = "Taras Kozlov" diff --git a/picows/picows.pyx b/picows/picows.pyx index 63a6c70..051f6b2 100644 --- a/picows/picows.pyx +++ b/picows/picows.pyx @@ -778,11 +778,15 @@ cdef class WSProtocol: self._process_new_data() # Benchmark and profiler showed that buffered protocol is actually slower - # then normal. There are additional costs of 2 python calls + # than normal. There are additional costs of 2 python calls # (get_buffer, buffer_updated) comparing to a single data_received. # Also extra costs are related to creating memoryview and getting buffer - # out of it - + # out of it. + # + # Uncommenting the following code will make uvloop to think that WSProtocol + # implements BufferedProtocol. uvloop will use get_buffer/buffer_updated + # instead of data_received. + # # def get_buffer(self, Py_ssize_t size_hint): # cdef Py_ssize_t sz = size_hint + 1024 # if self._buffer.size - self._f_new_data_start_pos < sz: