Skip to content

Commit 663d323

Browse files
committed
docs: fix emoji rendering and simplify architecture/batch docs
Add pymdownx.emoji extension to mkdocs.yml for FontAwesome icon rendering. Simplify architecture.md diagram and remove verbose MessagePack section. Streamline batch.md round-trip explanation.
1 parent 9dd28e2 commit 663d323

3 files changed

Lines changed: 10 additions & 29 deletions

File tree

docs/architecture.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ How PythonEmbed works under the hood.
44

55
## Overview
66

7-
PythonEmbed uses a **subprocess + MessagePack** model:
7+
PythonEmbed uses a **subprocess** model:
88

99
```
10-
┌─────────────┐ MessagePack frames ┌──────────────────┐
11-
│ JVM (Java) │ ◄──────────────────────────► │ CPython process │
12-
│ │ via stdin / stdout │ (bridge.py) │
13-
└─────────────┘ └──────────────────┘
10+
┌─────────────┐ ┌──────────────────┐
11+
│ JVM (Java) │ ◄──────────────────────► │ CPython process │
12+
│ │ via stdin / stdout │ (bridge.py) │
13+
└─────────────┘ └──────────────────┘
1414
```
1515

1616
Key design choices:
@@ -21,23 +21,7 @@ Key design choices:
2121

2222
## Communication Protocol
2323

24-
All communication happens via **MessagePack** binary protocol over stdin/stdout:
25-
26-
1. Java serializes a request (eval/exec/ref/callback/etc.) as a MessagePack frame
27-
2. The frame is prefixed with a 4-byte big-endian length header
28-
3. Python's `bridge.py` reads the length, then the full frame
29-
4. Python processes the request and writes a response frame back
30-
5. Java reads the response, deserializes, and returns the result
31-
32-
### Why MessagePack?
33-
34-
| Format | Size (typical) | Speed | Python support |
35-
|--------|---------------|-------|---------------|
36-
| MessagePack | ~50 bytes | Fast (binary) | `msgpack` package |
37-
| JSON | ~120 bytes | Medium | Built-in |
38-
| Pickle | ~40 bytes | Fast | Built-in (unsafe) |
39-
40-
MessagePack provides a compact binary format with strong typing, making it well-suited for cross-process communication over stdin/stdout.
24+
All communication happens via a binary protocol over stdin/stdout. Each request is serialized, prefixed with a 4-byte big-endian length header, and read by `bridge.py`. Python processes the request and writes a response frame back.
4125

4226
## Process Lifecycle
4327

docs/usage/batch.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ try (PythonEmbed py = PythonEmbed.create()) {
3838

3939
## Why Batch?
4040

41-
Each `eval()`/`exec()` call involves:
42-
1. Serialize request (MessagePack)
43-
2. Write to stdin (flush)
44-
3. Read from stdout
45-
4. Deserialize response (MessagePack)
46-
47-
Batch operations combine all requests into one MessagePack frame, eliminating N-1 round-trips.
41+
Each `eval()`/`exec()` call involves a full round-trip: serialize, write to stdin, read from stdout, and deserialize. Batch operations combine all requests into a single frame, eliminating N-1 round-trips.
4842

4943
## Batch with Pool
5044

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ markdown_extensions:
5858
- pymdownx.superfences
5959
- pymdownx.snippets
6060
- admonition
61+
- pymdownx.emoji:
62+
emoji_index: !!python/name:material.extensions.emoji.twemoji
63+
emoji_generator: !!python/name:material.extensions.emoji.to_svg

0 commit comments

Comments
 (0)