Details
-
Task
-
Status: Open (View Workflow)
-
Blocker
-
Resolution: Unresolved
-
2.0
-
None
-
3.13
Description
The current design represents column metadata as an array of objects ([ColumnDefinitionObject, ...]).
While convenient, this layout is suboptimal for performance-critical row parsing.
Problems with array-of-objects
- Each row access requires:
- Python object dereferencing
- Attribute lookups (col.type, col.flags, col.character_set, …)
- Attribute access is dynamic and expensive in tight loops.
- Poor cache locality: metadata for one column is scattered across multiple Python objects.
- Prevents efficient use of precomputed conversion tables.
Proposal: Replace this with a single ColumnsDefinitionObject holding parallel arrays:
Benefits
- Zero attribute lookups during row parsing
- Enables precomputed converter tables indexed by column number
- Improved cache locality and predictable memory access
- Cleaner separation:
- metadata preparation (once)
- row decoding
- Aligns naturally with binary protocol parsing and C-level optimizations
Attachments
Issue Links
- blocks
-
CONPY-336 Implement conversion tables for text and binary protocol parsing
-
- Open
-