Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datascript

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datascript - npm Package Versions

1
12

0.18.7

Diff

Changelog

Source

0.18.7

  • Enable :unique/identity and upserts for cardinality-many values (#321, thx @cjsauer)
tonsky
published 0.18.6 •

Changelog

Source

0.18.6

  • Extracted pprinting to separate ns (#318, thx @zajac)
tonsky
published 0.18.5 •

Changelog

Source

0.18.5

  • Fixed core.cljc NS declaration to require cljs.reader (#316, thx @Quezion)
tonsky
published 0.18.4 •

Changelog

Source

0.18.4

  • Added re-pattern and str/blank? str/includes? str/starts-with? str/ends-with? to built-ins (#306)
tonsky
published 0.18.3 •

Changelog

Source

0.18.3

  • Fixed vector misbehaving in queries in CLJS (#262)
tonsky
published 0.18.2 •

Changelog

Source

0.18.2

  • Fixed regression when transient indexes were mutated and iterated during single tx (#294).
  • Bumped persistent-sorted-set to 0.1.2 (throw if transient set is mutated and iterated at the same time).
  • Fixed regression when unique ref tempid was not resolved during transaction (#295).
tonsky
published 0.18.1 •

Changelog

Source

0.18.1

  • Bumped persistent-sorted-set to 0.1.1 (Java 8 bytecode)
tonsky
published 0.18.0 •

Changelog

Source

0.18.0

  • Fixed DB and Datom pprinting (#287)
  • Fixed cases when upsert resolves to tempid (#285)
  • Throw on tempid in :db.fn/cas (#264)
  • distinct aggregate returns set not a vector (thx @jdf-id-au)
  • Ability to run tests with Kaocha
  • [ BREAKING ] Some internals of datascript.arrays, datascript.btset and datascript.Datom type has changed

Performance optimizations for JVM version:

  • Reimplemented btset in Java with transients and better performance
  • Extracted btset to [persistent-sorted-set "0.1.0"]
  • Used raw ints in Datom intead of wrapped Integers, added stored in tx sign

Numbers I get on my 3.2 GHz i7-8700B (median time per test, ms):

| version | add-1 | add-5 | add-all | init | retract-5 | q1 | q2 | q3 | q4 | qpred1 | qpred2 | |------------------|---------|-------|---------|------|-----------|-----|------|------|------|--------|--------| | 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 | | 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 | | 0.9.5703-datomic | 1693.9 | 737.9 | 528.5 | --- | 1420.9 | 2.8 | 5.2 | 7.3 | 9.3 | 12.8 | 15.5 | | 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 |

Tests are as follows:

| Test | Description | |-----------|-------------| | add-1 | Add 100k datoms to an empty DB, one datom per transaction | | add-5 | Add 20k entities to an empty DB, 5 datoms per transaction, 100k datoms total | | add-all | Add 20k entities to an empty DB in a single transaction, 100k datoms total | | init | “Fast” datascript DB creation from an already sorted array of datoms (used in DB deserialization), 100k datoms | | retract-5 | Retract 20k entities from a DB with 100k datoms. Each entity removes 5 datoms. 1 entity per tx. | | q1 | Query with 1 clause over a DB with 100k datoms, ~12k tuples in resultset [:find ?e :where [?e :name "Ivan"]] | | q2 | Query with 2 clauses, 1 join, ~12k tuples [:find ?e ?a :where [?e :name "Ivan"] [?e :age ?a]] | | q3 | Query with 3 clauses, 2 joins, ~6k tuples [:find ?e ?a :where [?e :name "Ivan"] [?e :age ?a] [?e :sex :male]] | | 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]] | | qpred1 | Query with a predicate, ~50k tuples [:find ?e ?s :where [?e :salary ?s] [(> ?s 50000)]] | | qpred2 | Query with a predicate and dynamic input, ~50k tuples [:find ?e ?s :in $ ?min_s :where [?e :salary ?s] [(> ?s ?min_s)]] |

For Datomic an datomic:mem:// database was used.

What we see:

  • 20..40% faster transactions,
  • 75% faster deserialization (db-init),
  • No significant change on queries,
  • JVM transactions are more than twice as fast as V8,
  • JVM queries are 3-4 times as fast as V8,
  • DataScript transactions are 25..70% faster that Datomic in-memory. Query times vary.
tonsky
published 0.17.1 •

Changelog

Source

0.17.1

  • or, or-join, not and not-jon support in queries (#238, #50)
tonsky
published 0.17.0 •

Changelog

Source

0.17.0

  • Implement clojure.data/diff on datascript/DB (#281)
  • Drop Clojure 1.7 and 1.8 support
  • Fix externs.js syntax (PR #216, thx @thheller)
  • Support :as in Pull API an attr-with-opts syntax (#270, PR #271, thx @Jumblemuddle)
  • Support idents expansion (PR #245, thx bamarco)
  • JS API correctly handles nested maps with {":db/id"} in transactions (#228, thx @serebrianyi)
  • Calling transaction fns through idents directly (PR #185, thx @refset)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc