layout reader ctx#8037
Conversation
Signed-off-by: Onur Satici <onur@spiraldb.com>
Merging this PR will degrade performance by 16.59%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | chunked_varbinview_opt_canonical_into[(1000, 10)] |
187.7 µs | 225.1 µs | -16.59% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing os/layout-overrides (e8f8e0d) with develop (008c1d9)
| /// children helpers and survive any single stack frame. | ||
| #[derive(Clone, Default)] | ||
| pub struct LayoutReaderContext { | ||
| values: Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>, |
There was a problem hiding this comment.
would that import bug that hit our use of type id be relevant for this type of use as well? I can use the layout id here, I think it is a bit of a weirder api to have but should work
joseph-isaacs
left a comment
There was a problem hiding this comment.
Can we use a Array like Id instead of a TypeId
|
What's wrong with TypeId? We use this structure for all ephemeral context objects, i.e. VortexSession. It works correctly, is very fast, and helps keep it clear that this stuff is never serialized. The general |
Summary
Introduce
LayoutReaderContext, a typed-data registry threaded through reader construction so an ancestor layout can publish values that descendant layouts look up by type at construction time.Breaking: Layout::new_reader and VTable::new_reader gain a &LayoutReaderContext parameter. Out-of-tree impls will get a compile error and must add it