kornia/kornia-rs

[Refactor]: remove clone in Apriltag families

Open

#671 opened on Jan 27, 2026

View on GitHub
 (6 comments) (0 reactions) (1 assignee)Rust (188 forks)auto 404
good first issuehelp wantedtriage

Repository metrics

Stars
 (675 stars)
PR merge metrics
 (PR metrics pending)

Description

Title: Optimize TagFamilyKind::Custom cloning to avoid deep copies

Description

The TagFamilyKind enum currently stores custom tag families using a Box:

Custom(Box<TagFamily>),

This causes a full deep copy of the TagFamily data every time the enum is cloned. Since this data is typically read-only configuration, duplicating it is inefficient in terms of both memory and performance.

The goal is to address the TODO in the codebase by refactoring this variant to support cheap cloning (avoiding the allocation and copy) while maintaining necessary thread-safety guarantees.

Contributor guide