Commit graph

13 commits

Author SHA1 Message Date
J. Nick Koston
f9205cd88d
Avoid additional timestamp conversion to set state (#118885)
Avoid addtional timestamp conversion to set state

Since we already have the timestamp, we can pass it on to the State
object and avoid the additional timestamp conversion which can be as
much as 30% of the state write runtime.

Since datetime objects are limited to microsecond precision, we need
to adjust some tests to account for the additional precision that we
will now be able to get in the database
2024-06-05 23:43:34 -04:00
J. Nick Koston
9995207817
Avoid re-encoding the message id as bytes for every event/state change (#116460) 2024-04-30 12:02:28 -05:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
J. Nick Koston
60ab360fe7
Avoid bytes to string to bytes conversion in websocket api (#108139) 2024-01-16 21:37:34 +01:00
J. Nick Koston
03fcb81a59
Small speed up to compressed state diff (#106624) 2023-12-29 08:36:20 +01:00
J. Nick Koston
653da6e31f
Reduce websocket event and state JSON construction overhead (#101974) 2023-10-15 23:39:09 +02:00
J. Nick Koston
dae264f79e
Fix websocket_api _state_diff_event using json_encoder_default (#96905) 2023-07-19 18:22:43 +02:00
J. Nick Koston
b95405a7e9
Small performance improvements to state diff messages (#92963)
Adds missing test coverage
2023-05-14 12:28:34 -04:00
epenet
aa50096a31
Add type hints to integration tests (part 24) (#88307) 2023-02-17 16:34:53 +01:00
epenet
278050a73f
Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
J. Nick Koston
c9e46d360b
Use compact encoding for JSON websocket messages (#67148)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-23 22:15:20 -08:00
J. Nick Koston
4a3b40a3ef
Ensure websocket event serializer cache is effective if subscription iden differs (#42226)
Since someone websocket subscriptions will use an iden of 2 for
state_changed event (most comment), and some will use another
number for all events, the cache would not be used because the
iden number was different.  We now cache only the event and
use a fast replace to insert the iden number into the serailized
response.
2020-10-23 01:28:22 +02:00
J. Nick Koston
f0f817c361
Serialize websocket event message once (#40453)
Since most of the json serialize work for the websocket was done
multiple times for the same message, we can avoid the overhead
of serializing the same message many times (once per websocket
client) with a cache.
2020-09-22 08:47:04 -05:00