rdfjs / N3.js

Lightning fast, spec-compatible, streaming RDF for JavaScript
http://rdf.js.org/N3.js/
Other
712 stars 130 forks source link

performance: perform dataset operations directly on index #400

Open jeswr opened 1 month ago

jeswr commented 1 month ago

There is lots of room for optimisation in methods such as union and difference; in particular, whenever other is also an N3Store and they share an index we can just merge / diff / compare the indices for set operations.

See https://github.com/rdfjs/N3.js/pull/392/#discussion_r1694184951

jeswr commented 1 month ago

Many functions would benefit from using #structuredClone in their implementation. However, this would require an mver bump to deprecate old versions of Node as #structuredClone is only available from Node v17

RubenVerborgh commented 1 month ago

And browser? Maybe good to use it conditionally for now.

jeswr commented 1 month ago

Seems to be supported across all browsers now https://developer.mozilla.org/en-US/docs/Web/API/structuredClone#browser_compatibility