lance-format/lance

refactor: use LazyLock to initialize Field and Schema once

开放

#8,244 创建于 2026年8月4日

 (2 条评论) (0 个反应) (0 位负责人)Rust (695 个派生)github user discovery
good first issue

仓库指标

星标
 (6,582 个星标)
PR 合并指标
 (平均合并 6天 1小时) (30 天内合并 219 个 PR)

描述

In many places we output the same set of fields and/or schema per method call, or even per batch. This can be made cheaper if we initialize them once via a LazyLock and wrapping in an Arc.

Here's an example where we construct a schema per query:

https://github.com/lance-format/lance/blob/11eeb29161a2ac2763ff8cc6aa1fde8eb4592291/rust/lance-index/src/scalar/inverted/index.rs#L8107-L8116

贡献者指南