Optimize entities
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- clojure
- 領域
- databases, performance
調査の方向性
まず、現在のエンティティ属性ルックアップ、eavt インデックスと btset インデックス、および Iter の実装を読み、#226 の bounded-count に関する作業も確認してください。すべてのエンティティ datom をキャッシュする場合と Iter を保持する場合を比較し、大規模な参照セット向けの fallback を定義してください。多くの参照を持つエンティティで、メモリ使用量に問題を生じさせずにルックアップが高速化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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:
- What if the entity has a many ref with many many references?
- 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
Iterinstance that represents(Datom. eid nil nil nil nil), ie, all Datoms belonging to an entity. This is fast to get. - Enhance
Iterto allow fast searching within anIter. This would mean we can avoid thecacheof an entity and just lookup in theIter. - For avoiding performance problems with 1) we could add a heuristic to fall back to the current implementation when the
countof anIteris "too large" (> 20??). For this implementbounded-countforIter. See #226
- 主要言語
- Clojure
- スター
- 5.8k
- フォーク
- 318
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tonsky/datascript のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
tonsky/datascript#498 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
tonsky/datascript#489 ·
-
Stack overflow when transacting :db.type/tupleAttrs with a :db.type/ref attr through :db.fn/call オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#483 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#470 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
tonsky/datascript#441 · コメント 1 件 · リアクション 3 件 ·
tonsky/datascript の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
.Team/Metabot Priority:P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
needs triage
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
scalar-labs/scalar-jepsen#222 · コメント 1 件 ·