Skip to content

Conversation

@joseph-isaacs
Copy link
Contributor

Introduces a unified tree model for displaying hierarchical data structures:

  • Add DisplayTreeNode, Attr, AttrValue types in vortex-array/src/display/tree_model.rs
  • Add TreeDisplayable trait for lazy tree rendering
  • Add TreeDisplayOptions to control which attributes are included
  • Update DisplayLayoutTree in vortex-layout to:
    • Support lazy text display (via Display trait)
    • Support eager JSON serialization (via to_tree_node())
    • Use configurable options for attribute filtering
  • Add indexmap dependency for ordered children in JSON output

This provides a foundation for supporting both text and JSON output
without maintaining two separate code paths.

Signed-off-by: Claude noreply@anthropic.com

…JSON serialization

Introduces a unified tree model for displaying hierarchical data structures:

- Add `DisplayTreeNode`, `Attr`, `AttrValue` types in `vortex-array/src/display/tree_model.rs`
- Add `TreeDisplayable` trait for lazy tree rendering
- Add `TreeDisplayOptions` to control which attributes are included
- Update `DisplayLayoutTree` in vortex-layout to:
  - Support lazy text display (via Display trait)
  - Support eager JSON serialization (via to_tree_node())
  - Use configurable options for attribute filtering
- Add `indexmap` dependency for ordered children in JSON output

This provides a foundation for supporting both text and JSON output
without maintaining two separate code paths.

Signed-off-by: Claude <noreply@anthropic.com>
Add MaybeOwned<'a, T: ?Sized> type that allows TreeDisplayable::children()
to return either borrowed references (zero allocation) or owned boxed
values (for computed children like Layout).

This enables:
- DisplayTreeNode to borrow its stored children
- Layout to box computed children on demand
- Unified API for both cases via Deref

Also adds serde_json dev dependency for tests.

Signed-off-by: Claude <noreply@anthropic.com>
Document the unified tree display design including:
- MaybeOwned for flexible child ownership
- TreeDisplayable trait for lazy rendering
- Pluggable AttrProvider pattern for composable attribute extraction
- Future LazyJson design for JSONPath queries

Signed-off-by: Claude <noreply@anthropic.com>
@joseph-isaacs joseph-isaacs marked this pull request as draft January 24, 2026 16:22
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 24, 2026

CodSpeed Performance Report

Merging this PR will degrade performance by 40.82%

Comparing claude/unify-display-json-0G4Ng (03daae6) with develop (13f120f)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

⚡ 3 improved benchmarks
❌ 8 regressed benchmarks
✅ 1251 untouched benchmarks
⏩ 1290 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime u16_FoR[10M] 6.2 µs 10.4 µs -40.82%
WallTime u8_FoR[10M] 71.7 µs 5.8 µs ×12
Simulation canonical_into_non_nullable[(10000, 100, 0.01)] 2.1 ms 2.9 ms -27.41%
Simulation canonical_into_non_nullable[(10000, 100, 0.0)] 1.9 ms 2.7 ms -29.75%
Simulation canonical_into_non_nullable[(10000, 100, 0.1)] 3.7 ms 4.5 ms -18.17%
Simulation canonical_into_nullable[(10000, 10, 0.0)] 528.5 µs 444.3 µs +18.96%
Simulation canonical_into_nullable[(10000, 100, 0.0)] 4.9 ms 4.1 ms +19.65%
Simulation into_canonical_non_nullable[(10000, 100, 0.01)] 2.2 ms 3 ms -27.07%
Simulation into_canonical_non_nullable[(10000, 100, 0.0)] 1.9 ms 2.7 ms -29.42%
Simulation into_canonical_nullable[(10000, 100, 0.0)] 4.4 ms 5.2 ms -15.75%
Simulation into_canonical_non_nullable[(10000, 100, 0.1)] 3.8 ms 4.6 ms -17.72%

Footnotes

  1. 1290 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants