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

Formula performance improvements #173

Open
nsmith- opened this issue Mar 16, 2023 · 0 comments
Open

Formula performance improvements #173

nsmith- opened this issue Mar 16, 2023 · 0 comments
Labels
enhancement New feature or request evaluator Issues related to the evaluator

Comments

@nsmith-
Copy link
Collaborator

nsmith- commented Mar 16, 2023

The current formula implementation walks an AST on evaluation. The AST is not optimized beforehand.
We could improve this in a few ways:

  • Optimize the AST
  • Convert the AST into opcodes and run in a VM (is making our own stack better than AST walk? WIP attempt at master...formula_perf)
  • Find a way to statically link against llvm and compile to real machine code

A simpler solution might be to check if the formula is some regular pattern and convert it to a more specialized node. For example, we could create dedicated Horner-form polynomial evaluation nodes from formulas that are just multivariate polynomials. There is some literature on multivariate Horner forms e.g. https://arxiv.org/abs/1207.7079 and an existing python package: multivar_horner.

@nsmith- nsmith- added enhancement New feature or request evaluator Issues related to the evaluator labels Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request evaluator Issues related to the evaluator
Development

No branches or pull requests

1 participant