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

貢獻者指南