Skip to content

Commit

Permalink
Refactor and optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed Aug 15, 2024
1 parent 0fe8c2b commit 5df8734
Show file tree
Hide file tree
Showing 4 changed files with 348 additions and 376 deletions.
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ Introduction

picows is a library for building WebSocket clients and servers with a focus on performance.

Performance
===========
picows is implemented in Cython and provides unparalleled performance compared to other popular WebSocket libraries.

.. image:: https://raw.githubusercontent.com/tarasko/picows/master/docs/source/_static/picows_benchmark.png
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
templates_path = ['_templates']
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
# html_theme = "agogo"

html_static_path = ['_static']
34 changes: 0 additions & 34 deletions picows/picows.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -68,40 +68,6 @@ cdef class WSFrame:
cpdef bytes get_close_message(self)


cdef class WSFrameParser:
cdef:
bytes websocket_key_b64
object handshake_complete_future

object _logger

bint _log_debug_enabled
WSParserState _state
MemoryBuffer _buffer

# The following are the parts of an unfinished frame
# Once the frame is finished WSFrame is created and returned
size_t _f_new_data_start_pos
size_t _f_curr_state_start_pos
size_t _f_curr_frame_start_pos
uint64_t _f_payload_length
size_t _f_payload_start_pos
WSMsgType _f_msg_type
uint32_t _f_mask
uint8_t _f_fin
uint8_t _f_has_mask
uint8_t _f_payload_length_flag

cdef object get_buffer(self, size_t size_hint)
cdef buffer_updated(self, size_t nbytes)
cdef feed_data(self, bytes data)
cdef shrink_buffer(self)

cdef WSFrame get_next_frame(self)
cdef _handle_upgrade_response(self)
cdef bytes read_upgrade_request(self)


cdef class WSFrameBuilder:
cdef:
MemoryBuffer _write_buf
Expand Down
Loading

0 comments on commit 5df8734

Please sign in to comment.