Skip to content

BruJu/WasmTreeDataset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wasm Tree Dataset & Store

An implementation of RDF.JS Dataset and Store that partly resorts to Web Assembly.

Check wasm-tree-frontend/README.md for proper documentation about "how to use?"

Context

This repository is :

  • A BTreeDataset written in Rust that uses numbers (the backend)

  • A Javascript Wrapper class that is RDF/JS compliant (the frontend)

Getting Started / Usage

Tests

  • Run ./mocha (npm install mocha -g if needed) in wasm-tree-frontend.

Testing the backend

Tests are only done in Javascript from the front end. To test frontend modification you need to:

  • Modify wasm-tree-frontend dependencies to use the local wasm-tree-backend:
    • in package.json use this dependency "@bruju/wasm-tree-backend": "../wasm-tree-backend/pkg", in place of the current one.
  • Build the backend
    • cd wasm-tree-backend
    • ./buildpkg.py
  • Go in the frontend
    • cd ../wasm-tree-frontend
    • npm install
    • mocha

Build

Rust and wasm-pack are needed.

Compile and package the frontend:

  • cd wasm-tree-backend/
  • ./buildpkg.py
  • cd pkg
  • wasm-pack pack
  • cd ../../

Package the backend:

  • cd wasm-tree-frontend
  • npm pack

Benchmarks

The presented bench have been run on my computer (Dell Inspiron 15 5000 with a Intel(R) Core(TM) i5-1035G1 CPU), on nodejs / native rust.

For the tested .match function calls, we are always faster than Graphy and sophia_wasm and we are sometimes faster than Sophia itself.

Benchmarks can be found here

The benchmark infrastructure can be found here

License

MIT License