|
1 | 1 | # WIP |
2 | 2 |
|
| 3 | +- Fixed DB and Datom pprinting (#287) |
3 | 4 | - Fixed cases when upsert resolves to tempid (#285) |
4 | | -- Throw on tempid in `:db.fn/cas` (closes #264) |
| 5 | +- Throw on tempid in `:db.fn/cas` (#264) |
| 6 | +- `distinct` aggregate returns set not a vector (thx @jdf-id-au) |
| 7 | +- Ability to run tests with Kaocha |
| 8 | +- [ BREAKING ] Some internals of `datascript.arrays`, `datascript.btset` and `datascript.Datom` type has changed |
| 9 | + |
| 10 | +Performance optimizations for JVM version: |
| 11 | + |
| 12 | +- Reimplemented btset in Java with transients and better performance |
| 13 | +- Extracted btset to `[persistent-sorted-set "0.1.0"]` |
| 14 | +- Used raw ints in Datom intead of wrapped Integers, added stored in tx sign |
| 15 | + |
| 16 | +Numbers I get on my 3.2 GHz i7-8700B (median time per test, ms): |
| 17 | + |
| 18 | +| version | add-1 | add-5 | add-all | init | retract-5 | q1 | q2 | q3 | q4 | qpred1 | qpred2 | |
| 19 | +|------------------|---------|-------|---------|------|-----------|-----|------|------|------|--------|--------| |
| 20 | +| 0.17.1-jvm | 795.8 | 670.7 | 651.8 | 79.4 | 617.5 | 2.3 | 5.4 | 8.2 | 13.1 | 7.1 | 27.3 | |
| 21 | +| 0.18.0-jvm | 625.2 | 450.9 | 401.8 | 21.8 | 389.5 | 1.9 | 5.4 | 8.2 | 13.3 | 7.3 | 28.9 | |
| 22 | +| 0.9.5703-datomic | 1693.9 | 737.9 | 528.5 | --- | 1420.9 | 2.8 | 5.2 | 7.3 | 9.3 | 12.8 | 15.5 | |
| 23 | +| 0.18.0-v8 | 1231.6 | 963.1 | 930.3 | 76.5 | 809.1 | 6.4 | 15.2 | 23.8 | 33.6 | 24.2 | 24.5 | |
| 24 | + |
| 25 | +Tests are as follows: |
| 26 | + |
| 27 | +| Test | Description | |
| 28 | +|-----------|-------------| |
| 29 | +| add-1 | Add 100k datoms to an empty DB, one datom per transaction | |
| 30 | +| add-5 | Add 20k entities to an empty DB, 5 datoms per transaction, 100k datoms total | |
| 31 | +| add-all | Add 20k entities to an empty DB in a single transaction, 100k datoms total | |
| 32 | +| init | “Fast” datascript DB creation from an already sorted array of datoms (used in DB deserialization), 100k datoms | |
| 33 | +| retract-5 | Retract 20k entities from a DB with 100k datoms. Each entity removes 5 datoms. 1 entity per tx. | |
| 34 | +| q1 | Query with 1 clause over a DB with 100k datoms, ~12k tuples in resultset `[:find ?e :where [?e :name "Ivan"]]` | |
| 35 | +| q2 | Query with 2 clauses, 1 join, ~12k tuples `[:find ?e ?a :where [?e :name "Ivan"] [?e :age ?a]]` | |
| 36 | +| q3 | Query with 3 clauses, 2 joins, ~6k tuples `[:find ?e ?a :where [?e :name "Ivan"] [?e :age ?a] [?e :sex :male]]` | |
| 37 | +| q4 | Query with 4 clauses, 3 joins, ~6k tuples `[:find ?e ?l ?a :where [?e :name "Ivan"] [?e :last-name ?l] [?e :age ?a] [?e :sex :male]]` | |
| 38 | +| qpred1 | Query with a predicate, ~50k tuples `[:find ?e ?s :where [?e :salary ?s] [(> ?s 50000)]]` | |
| 39 | +| qpred2 | Query with a predicate and dynamic input, ~50k tuples `[:find ?e ?s :in $ ?min_s :where [?e :salary ?s] [(> ?s ?min_s)]]` | |
| 40 | + |
| 41 | +For Datomic an `datomic:mem://` database was used. |
| 42 | + |
| 43 | +What we see: |
| 44 | + |
| 45 | +- 20..40% faster transactions, |
| 46 | +- 75% faster deserialization (db-init), |
| 47 | +- No significant change on queries, |
| 48 | +- JVM transactions are more than twice as fast as V8, |
| 49 | +- JVM queries are 3-4 times as fast as V8, |
| 50 | +- DataScript transactions are 25..70% faster that Datomic in-memory. Query times vary. |
5 | 51 |
|
6 | 52 | # 0.17.1 |
7 | 53 |
|
|
0 commit comments