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.
rust
let data = PiBenchData::from_text(text);
bash
npm install pibench-parser
js
import { PiBenchData } from "pibench-parser";
const text = "YOUR PIBENCH RESULT";
const result = PiBenchData.from_text(text).to_js_value();
```python import ctypes from ctypes import ccharp, cvoidp, CDLL
sofile = "/path/to/libpibenchparser.so" functions = CDLL(so_file)
def texttojson(text): jsonstr = functions.texttojson(text.encode("utf-8")) try: return ctypes.cast(jsonstr, ccharp).value.decode("utf-8") finally: functions.freejsonstr(json_str) ```