mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-15 17:11:27 +00:00
remove alloc, dealloc in wasm
This commit is contained in:
@ -92,45 +92,12 @@ function wasmCompile() {
|
||||
}
|
||||
}
|
||||
|
||||
function wasmCompileAlloc() {
|
||||
let ptr = jpw.allocJson(getJson());
|
||||
if (ptr == 0) {
|
||||
console.error('Invalid pointer');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let template = jpw.compile(path);
|
||||
for (var i = 0; i < iter; i++) {
|
||||
let _ = template(ptr);
|
||||
}
|
||||
} finally {
|
||||
jpw.deallocJson(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
function wasmSelect() {
|
||||
for (var i = 0; i < iter; i++) {
|
||||
let _ = jpw.select(getJson(), path);
|
||||
}
|
||||
}
|
||||
|
||||
function wasmSelectAlloc() {
|
||||
let ptr = jpw.allocJson(getJson());
|
||||
if (ptr == 0) {
|
||||
console.error('Invalid pointer');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
for (var i = 0; i < iter; i++) {
|
||||
let _ = jpw.select(ptr, path);
|
||||
}
|
||||
} finally {
|
||||
jpw.deallocJson(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
function wasmSelectorClass() {
|
||||
let selector = new jpw.Selector();
|
||||
for (var i = 0; i < iter; i++) {
|
||||
|
Reference in New Issue
Block a user