lance-format/lance

refactor: use LazyLock to initialize Field and Schema once

Offen

#8.244 geöffnet am 04.08.2026

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (695 Forks)github user discovery
good first issue

Repository-Metriken

Stars
 (6.582 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 1h) (219 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide