feat: precompile decision content (#401)

* precompile first

* test

* add Opcode cache through Option<T>

* Compiled support for decisionTable,
default compile of new DecisionContent for node.js and py bindings

* format

* DecisionContent refactored to model module

* fmt

* added back BaseDecisionContent

* tests and benchmark

---------

Co-authored-by: Stefan <stefan@gorules.io>
This commit is contained in:
bcrevar-gorules
2025-11-21 14:44:24 +01:00
committed by GitHub
co-authored by Stefan
parent 611b489e49
commit 7bfebd90fe
15 changed files with 329 additions and 44 deletions
+3 -1
View File
@@ -14,7 +14,9 @@ pub struct PyZenDecisionContent(pub Arc<DecisionContent>);
impl PyZenDecisionContent {
#[new]
pub fn new(data: &str) -> PyResult<Self> {
let content = serde_json::from_str(data).context("Failed to parse JSON")?;
let mut content: DecisionContent =
serde_json::from_str(data).context("Failed to parse JSON")?;
content.compile();
Ok(Self(Arc::new(content)))
}
}