Skip to content

Commit

Permalink
debug heatmap, data processor, benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
SamedVossberg committed Nov 21, 2024
1 parent a50d357 commit 70ede93
Show file tree
Hide file tree
Showing 3 changed files with 246 additions and 0 deletions.
215 changes: 215 additions & 0 deletions gui_dev/data_processor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions gui_dev/data_processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "cbor_decoder"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_cbor = "0.11"
wasm-bindgen = { version = "0.2", features = ["serde-serialize"] }
serde-wasm-bindgen = "0.6.5"


[profile.release]
opt-level = "z" # Optimize for size (can be adjusted to 3 for speed)
lto = true # Enable Link-Time Optimization
codegen-units = 1 # Single codegen unit improves optimizations
12 changes: 12 additions & 0 deletions gui_dev/data_processor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use wasm_bindgen::prelude::*;
use serde_cbor::Value;
use serde_wasm_bindgen::to_value;

#[wasm_bindgen]
pub fn decode_cbor(data: &[u8]) -> JsValue {
match serde_cbor::from_slice::<Value>(data) {
Ok(value) => to_value(&value).unwrap_or(JsValue::NULL),
Err(_) => JsValue::NULL,
}
}

0 comments on commit 70ede93

Please sign in to comment.