Skip to content

perf: faster Expr.eval by precompiling expressions#197

Merged
tlambert03 merged 5 commits intopyapp-kit:mainfrom
tlambert03:faster-eval
May 17, 2024
Merged

perf: faster Expr.eval by precompiling expressions#197
tlambert03 merged 5 commits intopyapp-kit:mainfrom
tlambert03:faster-eval

Conversation

@tlambert03
Copy link
Copy Markdown
Member

@tlambert03 tlambert03 commented May 16, 2024

This PR moves the compilation of the expression to the __init__... this should make evaluating expressions up to ~30x faster (based on local testing).

It also allows passing kwargs: expr.eval(x=1, z=3) instead of expr.eval({"x": 1, "z": 3}) , though it will be slightly slower (sub-microsecond)

@tlambert03 tlambert03 changed the title feat: faster Expr.eval perf: faster Expr.eval May 16, 2024
@tlambert03 tlambert03 changed the title perf: faster Expr.eval perf: faster Expr.eval by precompiling expressions May 16, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented May 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (8289d03) to head (c2df7a2).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #197   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           31        31           
  Lines         1811      1810    -1     
=========================================
- Hits          1811      1810    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tlambert03 tlambert03 enabled auto-merge (squash) May 17, 2024 11:47
@tlambert03 tlambert03 merged commit 4d796c6 into pyapp-kit:main May 17, 2024
@tlambert03 tlambert03 deleted the faster-eval branch May 17, 2024 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant