Files
open-webui/backend/open_webui
Classic298 e2221fb662 perf: use the orjson codec to parse Jupyter kernel messages (#27812)
The code interpreter parses every message from the Jupyter kernel websocket with stdlib `json`, in a loop that runs for the duration of an execution. Messages carrying large stdout or a base64 image payload are the expensive ones.

It now goes through `JSONCodec`, which selects orjson when `ENABLE_ORJSON` is set. Every consumer of the parsed message reads strings only: `content.text`, `content.data['text/plain']` and `['image/png']`, `content.traceback`, and `content.execution_state`. Jupyter renders large integers into `text/plain` as strings rather than JSON numbers, so no numeric round trip is involved.

The one-shot `execute_request` message this module sends keeps stdlib `json`; it is a small fixed-shape dict sent once per execution.

With `ENABLE_ORJSON` unset, which is the default, `JSONCodec` is stdlib `json` and this call site behaves exactly as before.
2026-07-31 17:32:05 -04:00
..
…
2026-07-27 04:46:45 -04:00
2026-07-27 19:39:36 -04:00
2026-07-27 19:39:36 -04:00
2026-07-27 19:39:36 -04:00
2026-07-27 19:39:36 -04:00
2026-07-27 19:39:36 -04:00
2026-07-27 19:39:36 -04:00
2026-07-23 03:39:56 -04:00
2026-07-26 22:45:11 -04:00