[wasm] Expose Engine.clone to bindings
Maintainers usually reply within 1 day
Assessment
This issue has not been assessed yet.
Description
While the Engine in wasm binding implements the Clone trait, it's not currently exposed in wasm binding, so there doesn't seem to be way to clone from Javascript.
A small clone method on Engine could be added to allow cloning in Javascript.
I was running a benchmark on Clone where I would clone before each evaluation, I noticed that without running a dummy evaluation first before cloning, each evaluation after cloning would be very slow.
I have to basically do (psuedocode)
template := new Engine()
engine.addPolicy(...)
engine.addDataJson(..)
engine.addInputJson(dummy)
engine.evalRule(dummy rule) // Without this evaluation, each eval after clone is very expensive.
for each loop {
e := template.clone()
e.addInputJson(...)
e.evalRule(....)
}
To avoid using dummy inputs, can an API be provided in Rust, so we can call engine.prepare() after addDataJson.
I was using almost 1MB rego file.
- Dominant language
- Rust
- Stars
- 375
- Forks
- 81
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 78
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/regorus
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
RVM: errors and conflicts in rule bodies evaluate to undefined, even with strict builtin errorsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
microsoft/regorus#932 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
Maintainers usually reply within 1 day
All issues in microsoft/regorus
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day
-
documentation target:powerpoint
Difficulty 1/5 Under an hour Newbie friendliness 76/100
tomast1337/PdfLapas#602 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day