2016-07-08 19:49:55 +00:00
|
|
|
(defproject datomish "0.1.0-SNAPSHOT"
|
2016-07-05 19:05:49 +00:00
|
|
|
:description "A persistent, embedded knowledge base inspired by Datomic and DataScript."
|
|
|
|
:url "https://github.com/mozilla/datomish"
|
|
|
|
:license {:name "Mozilla Public License Version 2.0"
|
2016-07-06 01:55:55 +00:00
|
|
|
:url "https://github.com/mozilla/datomish/blob/master/LICENSE"}
|
2016-07-06 01:13:29 +00:00
|
|
|
:dependencies [[org.clojure/clojurescript "1.9.89"]
|
2016-07-11 23:48:40 +00:00
|
|
|
[org.clojure/clojure "1.8.0"]
|
|
|
|
[org.clojure/core.async "0.2.385"]
|
2016-07-06 23:53:08 +00:00
|
|
|
[datascript "0.15.1"]
|
2016-08-05 20:06:42 +00:00
|
|
|
[honeysql "0.8.0"]
|
Completely rewrite main transaction logic to be faster.
This is almost complete; it passes the test suite save for retracting
fulltext datoms correctly.
There's a lot to say about this approach, but I don't have time to give
too many details. The broad outline is as follows. We collect datoms
to add and retract in a tx_lookup table. Depending on flags ("search
value" sv and "search value type tag" svalue_type_tag) we "complete" the
tx_lookup table by joining matching datoms. This allows us to find
datoms that are present (and should not be added as part of the
transaction, or should be retracted as part of the transaction, or
should be replaced as part of the transaction. We complete the
tx_lookup (in place!) in two separate INSERTs to avoid a quadratic
two-table walk (explain the queries to observe that both INSERTs walk
the lookup table once and then use the datoms indexes to complete the
matching values).
We could simplify the code by using multiple lookup tables, both for the
two cases of search parameters (eav vs. ea) and for the incomplete and
completed rows. Right now we differentiate the former with NULL checks,
and the latter by incrementing the added0 column. It performs well
enough, so I haven't tried to understand the performance of separating
these things.
After the tx_lookup table is completed, we build the transaction from
it; and update the datoms materialized view table as well. Observe the
careful handling of the "search value" sv parameters to handle replacing
:db.cardinality/one datoms.
Finally, we read the processed transaction back to produce to the API.
This is strictly to match the Datomic API; we might make allow to skip
this, since many consumers will not want to stream this over the wire.
Rough timings show the transactor processing a single >50k datom
transaction in about 3.5s, of which less than 0.5s is spent in the
expensive joins. Further, repeating the processing of the same
transaction is only about 3.5s again! That's the worst possible for the
joins, since every single inserted datom will already be present in the
database, making the most expensive join match every row.
2016-08-09 06:30:45 +00:00
|
|
|
[com.taoensso/tufte "1.0.2"]
|
2016-07-11 23:48:40 +00:00
|
|
|
[jamesmacaulay/cljs-promises "0.1.0"]]
|
2016-07-06 01:13:29 +00:00
|
|
|
|
2016-07-06 01:55:55 +00:00
|
|
|
:cljsbuild {:builds {:release {
|
|
|
|
:source-paths ["src"]
|
|
|
|
:assert false
|
|
|
|
:compiler {:output-to "release-js/datomish.bare.js"
|
|
|
|
:optimizations :advanced
|
|
|
|
:pretty-print false
|
|
|
|
:elide-asserts true
|
|
|
|
:output-wrapper false
|
|
|
|
:parallel-build true}
|
|
|
|
:notify-command ["release-js/wrap_bare.sh"]}
|
|
|
|
:advanced {:source-paths ["src"]
|
|
|
|
:compiler {:output-to "target/advanced/datomish.js"
|
|
|
|
:optimizations :advanced
|
|
|
|
:source-map "target/advanced/datomish.js.map"
|
|
|
|
:pretty-print true
|
2016-07-13 23:16:31 +00:00
|
|
|
:recompile-dependents true
|
2016-07-06 01:55:55 +00:00
|
|
|
:parallel-build true
|
|
|
|
}}
|
|
|
|
:test {
|
|
|
|
:source-paths ["src" "test"]
|
|
|
|
:compiler {:output-to "target/test/datomish.js"
|
|
|
|
:output-dir "target/test"
|
|
|
|
:main datomish.test
|
|
|
|
:optimizations :none
|
|
|
|
:source-map true
|
2016-07-13 23:16:31 +00:00
|
|
|
:recompile-dependents true
|
2016-07-06 01:55:55 +00:00
|
|
|
:parallel-build true
|
|
|
|
:target :nodejs
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
}
|
2016-07-06 01:13:29 +00:00
|
|
|
|
2016-07-08 19:44:57 +00:00
|
|
|
:profiles {:dev {:dependencies [[cljsbuild "1.1.3"]
|
2016-07-12 05:02:53 +00:00
|
|
|
[tempfile "0.2.0"]
|
2016-07-08 19:44:57 +00:00
|
|
|
[com.cemerick/piggieback "0.2.1"]
|
|
|
|
[org.clojure/tools.nrepl "0.2.10"]
|
2016-07-12 05:02:53 +00:00
|
|
|
[org.clojure/java.jdbc "0.6.2-alpha1"]
|
|
|
|
[org.xerial/sqlite-jdbc "3.8.11.2"]]
|
2016-08-19 16:20:50 +00:00
|
|
|
:jvm-opts ["-Xss4m"]
|
2016-07-06 01:13:29 +00:00
|
|
|
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
2016-07-08 19:44:57 +00:00
|
|
|
:plugins [[lein-cljsbuild "1.1.3"]
|
2016-08-26 00:23:25 +00:00
|
|
|
[lein-doo "0.1.6"]
|
|
|
|
[venantius/ultra "0.4.1"]
|
|
|
|
[com.jakemccrary/lein-test-refresh "0.16.0"]]
|
2016-07-06 01:55:55 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
:doo {:build "test"}
|
2016-07-06 01:13:29 +00:00
|
|
|
|
|
|
|
:clean-targets ^{:protect false} ["target"
|
|
|
|
"release-js/datomish.bare.js"
|
|
|
|
"release-js/datomish.js"]
|
|
|
|
)
|