Optimize entities

Aperta
#227 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
clojure

Direzione di ricerca

Inizia leggendo l’attuale ricerca degli attributi delle entità, gli indici eavt e btset e l’implementazione di Iter; esamina anche il lavoro sui conteggi limitati in #226. Confronta la memorizzazione nella cache di tutti i datom dell’entità con il mantenimento di un Iter e definisci un fallback per gli insiemi di riferimenti grandi. Il lavoro è completo quando le ricerche sono più veloci senza un uso problematico della memoria per le entità con molti riferimenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Also partially dicussed on Slack:

Currently an attribute lookup on an entity does a search into the btset and then caches the result. This is inefficient since the all the attribute values are right next to each other in the eavt index.
Getting them all at once and storing them in a cache makes sense, but has huge problem:

  1. What if the entity has a many ref with many many references?
  2. What if the entity has MANY attributes

I think 2) is unlikely a use-case and can be ignored. However 1) is an issue.

Ideas:

  • Save an Iter instance that represents (Datom. eid nil nil nil nil), ie, all Datoms belonging to an entity. This is fast to get.
  • Enhance Iter to allow fast searching within an Iter. This would mean we can avoid the cache of an entity and just lookup in the Iter.
  • For avoiding performance problems with 1) we could add a heuristic to fall back to the current implementation when the count of an Iter is "too large" (> 20??). For this implement bounded-count for Iter. See #226
Lingua principale
Clojure
Stelle
5.8k
Fork
318
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tonsky/datascript

Tutte le issue di tonsky/datascript

Issue simili

Altre issue su Clojure

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.