Skip to content

Commit d9caf92

Browse files
jensensclaude
andcommitted
Use sentence case for all Sphinx documentation headings
Align heading style with Plone documentation style guide which follows the Microsoft Writing Style Guide: only capitalize the first word and proper nouns in headings. Affects 12 files across tutorials, how-to guides, reference, and explanation sections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 76c33b0 commit d9caf92

12 files changed

Lines changed: 57 additions & 57 deletions

File tree

docs/sources/explanation/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ flowchart LR
4242
JW --> JS2["JSON string<br/>(direct write)"]
4343
```
4444

45-
### Step 1: Pickle parsing (decode.rs)
45+
### Step 1: pickle parsing (decode.rs)
4646

4747
The decoder implements a pickle virtual machine that reads opcodes and builds
4848
up the `PickleValue` tree. It maintains a stack, a memo (for shared

docs/sources/explanation/optimization-journal.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Optimization Journal
1+
# Optimization journal
22

33
<!-- diataxis: explanation -->
44

@@ -31,7 +31,7 @@ of cloning avoids a deep copy of the entire PickleValue tree.
3131

3232
**Impact:** ~1.8x faster encode path.
3333

34-
### 2. Bypass serde_json intermediate
34+
### 2. bypass serde_json intermediate
3535

3636
**Technique:** Added `src/pyconv.rs` for direct `PickleValue` to/from
3737
`PyObject` conversion, eliminating `serde_json::Value` as an intermediate
@@ -47,7 +47,7 @@ allocation and traversal.
4747

4848
**Impact:** 2-3.5x faster across most categories.
4949

50-
### 3. Decode path tuning
50+
### 3. decode path tuning
5151

5252
**Technique:** Single-pass Dict decode, pre-allocated `Vec::with_capacity()`,
5353
set/frozenset move semantics (no `Vec` clone), `StackItem` removal, `@`
@@ -62,7 +62,7 @@ keys like `"title"`, `"description"`) skip all 15+ marker key comparisons.
6262

6363
**Impact:** Codec competitive with CPython pickle decode.
6464

65-
### 4. Encode marker fast path
65+
### 4. encode marker fast path
6666

6767
**Technique:** Single-key dicts use direct key extraction plus match instead
6868
of 15 sequential `dict.get_item()` calls. 2-4 key dicts use a single-pass
@@ -81,7 +81,7 @@ prefixed keys and matches on the first character after `@`.
8181

8282
**Impact:** Reduced `get_item()` calls for `@cls` + `@s` from ~16 to 2.
8383

84-
### 5. Direct PyObject encoder
84+
### 5. direct PyObject encoder
8585

8686
**Technique:** `pyconv.rs` encode path writes pickle opcodes straight from
8787
Python objects, bypassing the PickleValue tree allocation. Handles common
@@ -95,7 +95,7 @@ we eliminate the entire intermediate tree.
9595

9696
**Impact:** Encode competitive with CPython C pickler.
9797

98-
### 6. Shared ZODB memo
98+
### 6. shared ZODB memo
9999

100100
**Technique:** Single Decoder instance processes both class and state pickles,
101101
preserving memo entries across the boundary.
@@ -124,7 +124,7 @@ requests concurrently.
124124
single-thread speedup, but significant throughput improvement in
125125
multi-threaded deployments.
126126

127-
### 8. Single-pass PG decode
127+
### 8. single-pass PG decode
128128

129129
**Technique:** `decode_zodb_record_for_pg()` combines decode + persistent
130130
reference extraction + null-byte sanitization in one function, eliminating two
@@ -141,7 +141,7 @@ two full traversals.
141141

142142
## v1.3.0
143143

144-
### 9. Box Instance variant
144+
### 9. box instance variant
145145

146146
**Technique:** Changed `Instance(InstanceData)` to `Instance(Box<InstanceData>)`
147147
in the `PickleValue` enum.
@@ -164,7 +164,7 @@ utilization.
164164

165165
## v1.3.1
166166

167-
### 10. Thin LTO + codegen-units=1
167+
### 10. thin LTO + codegen-units=1
168168

169169
**Technique:** Set `lto = "thin"` and `codegen-units = 1` in the Cargo release
170170
profile.
@@ -185,7 +185,7 @@ increase is modest and the performance gain is consistent.
185185

186186
## v1.4.0
187187

188-
### 11. Direct pickle-to-JSON string path
188+
### 11. direct pickle-to-JSON string path
189189

190190
**Technique:** `decode_zodb_record_for_pg_json()` converts ZODB pickle records
191191
entirely in Rust, producing a JSON string directly. The GIL is released for
@@ -204,7 +204,7 @@ allocation.
204204
**Impact:** 1.3x faster full pipeline on real-world data, plus improved
205205
multi-threaded throughput from GIL release.
206206

207-
## v1.5.0 -- Encode Performance Rounds 1-4
207+
## v1.5.0 -- encode performance rounds 1-4
208208

209209
### Round 1
210210

@@ -232,7 +232,7 @@ this replaces ~20 string comparisons with a single hash probe.
232232
**Impact:** Measurable improvement across all encode benchmarks, especially
233233
for integer-heavy and large-dict payloads.
234234

235-
#### 13. Profile-Guided Optimization (PGO)
235+
#### 13. profile-guided optimization (PGO)
236236

237237
**Technique:** Two-pass instrumented build. First pass collects execution
238238
profiles using real FileStorage data (5 MB Wikipedia database, 1,692 records)
@@ -259,7 +259,7 @@ can exploit.
259259

260260
### Round 2
261261

262-
#### 14. Direct known-type encoding
262+
#### 14. direct known-type encoding
263263

264264
**Technique:** For `@dt`, `@date`, `@time`, `@td`, `@dec` markers: write
265265
pickle opcodes directly to the output buffer instead of allocating
@@ -279,7 +279,7 @@ sequence of buffer writes.
279279

280280
**Impact:** special_types **9.2x faster** than Python pickle.
281281

282-
#### 15. Thread-local buffer reuse
282+
#### 15. thread-local buffer reuse
283283

284284
**Technique:** `ENCODE_BUF` thread-local `Vec<u8>` retains capacity across
285285
calls. On each encode, the buffer is cleared (length reset to 0) but the
@@ -305,7 +305,7 @@ sharing), and the memory cost is bounded (one buffer per thread).
305305

306306
### Round 3
307307

308-
#### 16. Direct JSON string writer
308+
#### 16. direct JSON string writer
309309

310310
**Technique:** `json_writer.rs` writes JSON tokens directly from the
311311
`PickleValue` AST to a `String` buffer. Fast-path string escaping (scan for
@@ -333,7 +333,7 @@ floats to strings without going through `format!()`, avoiding a temporary
333333

334334
### Round 4
335335

336-
#### 17. Class pickle cache
336+
#### 17. class pickle cache
337337

338338
**Technique:** Thread-local cache per `(module, name)` pair. Linear search
339339
over ~6 entries (faster than `HashMap` for small sets). First call builds and

docs/sources/explanation/why-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Why Convert Pickle to JSON?
1+
# Why convert pickle to JSON?
22

33
<!-- diataxis: explanation -->
44

docs/sources/how-to/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How-To Guides
1+
# How-to guides
22

33
<!-- diataxis: how-to -->
44

docs/sources/how-to/run-benchmarks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ All benchmark commands accept:
7979

8080
Profile-Guided Optimization (PGO) produces the most accurate performance numbers by optimizing based on actual benchmark workloads.
8181

82-
### 1. Install LLVM tools
82+
### 1. install LLVM tools
8383

8484
```bash
8585
rustup component add llvm-tools
8686
```
8787

88-
### 2. Instrumented build
88+
### 2. instrumented build
8989

9090
Build with profiling instrumentation enabled:
9191

9292
```bash
9393
RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data" maturin develop --release
9494
```
9595

96-
### 3. Generate profiles
96+
### 3. generate profiles
9797

9898
Run both benchmark types to capture representative workload data:
9999

@@ -102,13 +102,13 @@ python benchmarks/bench.py synthetic --iterations 5000
102102
python benchmarks/bench.py filestorage benchmarks/bench_data/Data.fs
103103
```
104104

105-
### 4. Merge profile data
105+
### 4. merge profile data
106106

107107
```bash
108108
llvm-profdata merge -o /tmp/pgo-data/merged.profdata /tmp/pgo-data/*.profraw
109109
```
110110

111-
### 5. Final PGO build
111+
### 5. final PGO build
112112

113113
```bash
114114
RUSTFLAGS="-Cprofile-use=/tmp/pgo-data/merged.profdata" maturin develop --release

docs/sources/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Designed as the codec layer for a PostgreSQL JSONB storage backend.
6363

6464
::::
6565

66-
## Quick Start
66+
## Quick start
6767

6868
1. {doc}`Install zodb-json-codec <how-to/install>`
6969
2. {doc}`Encode and decode your first pickle <tutorials/getting-started>`

docs/sources/reference/btree-format.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# BTree Format
1+
# BTree format
22

33
<!-- diataxis: reference -->
44

55
BTrees from the `BTrees` package store their state as deeply nested
66
tuples in pickle. The codec flattens these into human-readable,
77
JSONB-queryable JSON while preserving full roundtrip fidelity.
88

9-
## Supported BTree Classes
9+
## Supported BTree classes
1010

1111
All classes matching the pattern `BTrees.{PREFIX}BTree.{PREFIX}{Type}`
1212
are recognized, where `{Type}` is one of `BTree`, `Bucket`, `TreeSet`,
@@ -28,7 +28,7 @@ or `Set`.
2828
| `QQ` | unsigned long | unsigned long |
2929
| `fs` | FileStorage | (internal) |
3030

31-
### Node Types
31+
### Node types
3232

3333
BTree
3434
: Tree node for maps. Small trees use 4-level tuple nesting for inline
@@ -44,7 +44,7 @@ TreeSet
4444
Set
4545
: Leaf node for sets. Same structure as Bucket but stores keys only.
4646

47-
## `@kv` -- Key-Value Pairs
47+
## `@kv` -- key-value pairs
4848

4949
Used for map-type BTree nodes (BTree, Bucket). Contains an array of
5050
`[key, value]` pairs.

docs/sources/reference/json-format.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# JSON Format
1+
# JSON format
22

33
<!-- diataxis: reference -->
44

55
This page describes how Python types are represented in JSON by
66
zodb-json-codec. All representations are **roundtrip-safe**: encoding to
77
JSON and decoding back produces identical pickle bytes.
88

9-
## Native JSON Types
9+
## Native JSON types
1010

1111
These Python types map directly to JSON without any markers:
1212

@@ -20,12 +20,12 @@ These Python types map directly to JSON without any markers:
2020
| `list` | array | `[1, 2, 3]` |
2121
| `dict` (string keys) | object | `{"key": "value"}` |
2222

23-
## Structural Markers
23+
## Structural markers
2424

2525
These markers preserve Python types that have no direct JSON equivalent.
2626
Each uses a single-key dict with a `@`-prefixed key.
2727

28-
### `@t` -- Tuple
28+
### `@t` -- tuple
2929

3030
```json
3131
{"@t": [1, 2, 3]}

docs/sources/reference/project-structure.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Project Structure
1+
# Project structure
22

33
<!-- diataxis: reference -->
44

55
Source layout and module responsibilities for the zodb-json-codec Rust
66
crate and Python package.
77

8-
## Directory Layout
8+
## Directory layout
99

1010
```
1111
src/
@@ -34,9 +34,9 @@ benchmarks/
3434
bench.py # Performance benchmarks vs CPython pickle
3535
```
3636

37-
## Rust Modules
37+
## Rust modules
3838

39-
### `lib.rs` -- PyO3 Module
39+
### `lib.rs` -- PyO3 module
4040

4141
Defines the Python-facing functions (`#[pyfunction]`) that are exported
4242
as the `zodb_json_codec._rust` extension module. Each function
@@ -56,7 +56,7 @@ Also defines `InstanceData` (module, name, state, plus optional
5656
`dict_items` and `list_items` for subclass support). The `Instance`
5757
variant is boxed to keep the enum size at 48 bytes.
5858

59-
### `decode.rs` -- Pickle Decoder
59+
### `decode.rs` -- pickle decoder
6060

6161
Implements a subset of the pickle virtual machine sufficient for ZODB
6262
records (protocol 2-3, partial protocol 4). Reads pickle bytes and
@@ -71,7 +71,7 @@ Key functions:
7171
Safety limits: memo capped at 100,000 entries, binary allocations capped
7272
at 256 MB, LONG text at 10,000 characters.
7373

74-
### `encode.rs` -- Pickle Encoder
74+
### `encode.rs` -- pickle encoder
7575

7676
Converts a `PickleValue` AST back to pickle bytes in protocol 3 (the
7777
maximum supported by zodbpickle). Handles all value types including
@@ -80,7 +80,7 @@ maximum supported by zodbpickle). Handles all value types including
8080
Recursion depth is limited to 1,000 levels. Integers are encoded with
8181
minimal byte length for signed little-endian representation.
8282

83-
### `pyconv.rs` -- Direct PyObject Bridge
83+
### `pyconv.rs` -- direct PyObject bridge
8484

8585
The fast path for the Python dict API. Converts between `PickleValue`
8686
AST and Python objects directly, bypassing the `serde_json::Value`
@@ -98,7 +98,7 @@ Provides both standard and PG-specific variants:
9898
BTree-aware decode.
9999
- `collect_refs_from_pickle_value` -- extract persistent reference OIDs.
100100

101-
### `json.rs` -- JSON String Path
101+
### `json.rs` -- JSON string path
102102

103103
Converts between `PickleValue` AST and `serde_json::Value` for the JSON
104104
string API (`pickle_to_json`, `json_to_pickle`). Also provides the
@@ -114,15 +114,15 @@ Key functions:
114114
- `pickle_value_to_json_string_pg` -- direct string output for PG
115115
(uses `json_writer.rs`).
116116

117-
### `json_writer.rs` -- Direct JSON String Writer
117+
### `json_writer.rs` -- direct JSON string writer
118118

119119
A low-level JSON token writer that appends directly to a `String`
120120
buffer. Used by the PG JSON path to avoid allocating intermediate
121121
`serde_json::Value` nodes entirely. Writes JSON tokens (object open/
122122
close, array open/close, strings, numbers, booleans, null) as raw
123123
characters.
124124

125-
### `known_types.rs` -- Known Type Handlers
125+
### `known_types.rs` -- known type handlers
126126

127127
Intercepts common Python REDUCE patterns at the PickleValue/JSON
128128
boundary and produces compact typed markers instead of generic `@reduce`
@@ -139,7 +139,7 @@ output. Handles both directions:
139139
Full timezone support: naive, fixed-offset (`datetime.timezone`),
140140
pytz (including named zones with full constructor args), and zoneinfo.
141141

142-
### `btrees.rs` -- BTree State Handling
142+
### `btrees.rs` -- BTree state handling
143143

144144
Classifies BTree classes by module/name and flattens their deeply nested
145145
tuple state into queryable JSON. Handles both directions:
@@ -151,7 +151,7 @@ tuple state into queryable JSON. Handles both directions:
151151
- **Classification**: `classify_btree` -- identify BTree class and node
152152
kind from module/name strings.
153153

154-
### `zodb.rs` -- ZODB Record Handling
154+
### `zodb.rs` -- ZODB record handling
155155

156156
Handles the ZODB two-pickle record format. Provides:
157157

@@ -164,19 +164,19 @@ Handles the ZODB two-pickle record format. Provides:
164164
Also contains `#[cfg(test)]` encode functions for ZODB record
165165
roundtrip testing.
166166

167-
### `opcodes.rs` -- Pickle Opcode Constants
167+
### `opcodes.rs` -- pickle opcode constants
168168

169169
Defines constants for all pickle opcodes from protocol 0 through 5. The
170170
codec focuses on protocol 2-3 (ZODB standard) but includes protocol 4-5
171171
opcodes for partial forward compatibility.
172172

173-
### `error.rs` -- Error Types
173+
### `error.rs` -- error types
174174

175175
Defines `CodecError` with variants for all failure modes: unexpected
176176
EOF, unknown opcode, stack underflow, invalid data, JSON errors, and
177177
invalid UTF-8. Implements conversion to Python `ValueError` via PyO3.
178178

179-
## Data Flow
179+
## Data flow
180180

181181
The following diagram shows the three conversion paths through the
182182
codebase:

0 commit comments

Comments
 (0)