Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT version #107

Open
darky opened this issue Sep 26, 2021 · 1 comment
Open

JIT version #107

darky opened this issue Sep 26, 2021 · 1 comment

Comments

@darky
Copy link

darky commented Sep 26, 2021

Hello @jwadhams! Thanks you very much for this awesome library! 🎸

I inspired and create JIT version of json-logic-js -> https://github.com/darky/json-logic-js-jit
json-logic-js-jit precompile JSON schemas and then you deal with high performance JS functions 🚀

Maybe it's not silver bullet and can't be used in cases, when need "infinite" count of JSON rules, which are generated chaotically by a third party (althrough json-logic-js-jit can be used here as LRU cache).
But for my project is ok, supposed ~100-200 predefined JSON rules.

Benchmark results on local machine 👇

Initial compile included in benchmark:

json-logic-js-jit x 174,811,960 ops/sec ±0.50% (93 runs sampled) // x163 faster
json-logic-js x 1,072,400 ops/sec ±0.55% (95 runs sampled)

Initial compile not included in benchmark:

json-logic-js-jit x 759,229,202 ops/sec ±1.45% (88 runs sampled) // x712 faster
json-logic-js x 1,064,846 ops/sec ±0.61% (96 runs sampled) 

@jwadhams, feel free to inspire and port JIT into json-logic-js too (I can deprecate json-logic-js-jit in this case).
Also, you can specify json-logic-js-jit in documentation as JIT alternative (my appreciation in this case 🙌 )

@fasiha
Copy link

fasiha commented Jun 5, 2022

For completeness, here's another more heavyweight tool with a similar goal: https://github.com/TotalTechGeek/json-logic-engine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants