Crates.io | pibench-parser |
lib.rs | pibench-parser |
version | 0.1.7 |
source | src |
created_at | 2020-05-26 22:00:28.731928 |
updated_at | 2020-06-07 23:41:09.505537 |
description | A simple parser to parse the text output from pibench |
homepage | |
repository | https://github.com/XiangpengHao/pibench-output-parser |
max_upload_size | |
id | 246362 |
size | 26,529 |
A simple parser to parse the text output from pibench.
Current PiBench does not support json/csv output yet; it prints the output to stdout
and stderr
.
We sometimes need to process hundreds of such text files, thus need a programmatic way to extract the useful information.
A shared library that can be called from Python. ✔️
A Webassembly version to support pibench-online. ✔️
Native rust version for pibench backend server. ✔️
let data = PiBenchData::from_text(text);
npm install pibench-parser
import { PiBenchData } from "pibench-parser";
const text = "YOUR PIBENCH RESULT";
const result = PiBenchData.from_text(text).to_js_value();
import ctypes
from ctypes import c_char_p, c_void_p, CDLL
so_file = "/path/to/libpibench_parser.so"
functions = CDLL(so_file)
def text_to_json(text):
json_str = functions.text_to_json(text.encode("utf-8"))
try:
return ctypes.cast(json_str, c_char_p).value.decode("utf-8")
finally:
functions.free_json_str(json_str)