Skip to content

python(feat): Reduce API calls when creating rules with caching.#430

Merged
marc-sift merged 3 commits into
mainfrom
cache-api-calls-during-rule-eval
Dec 12, 2025
Merged

python(feat): Reduce API calls when creating rules with caching.#430
marc-sift merged 3 commits into
mainfrom
cache-api-calls-during-rule-eval

Conversation

@marc-sift
Copy link
Copy Markdown
Contributor

@marc-sift marc-sift commented Dec 12, 2025

Updated the example to generate 1000s rules:
Before:

(venv) ~/code/sift/python/examples/rule_evaluation/external_rules/python_config$ time python main.py --run_id=59cefdcd-2b6f-4c81-97dd-f2c0ff942a41
Report ID: abef4507-8d0f-4c62-80e0-0ce435a00eb2

real    4m0.067s
user    0m3.334s
sys     0m0.346s

After:

(venv) ~/code/sift/python/examples/rule_evaluation/external_rules/python_config$ time python main.py --run_id=59cefdcd-2b6f-4c81-97dd-f2c0ff942a41
Report ID: 6f54f7fb-223b-4593-8d84-35a299b04c97

real    0m37.601s
user    0m1.400s
sys     0m0.105s

Comment thread python/lib/sift_py/rule_evaluation/service.py Outdated
dengjonathan
dengjonathan previously approved these changes Dec 12, 2025
Copy link
Copy Markdown
Contributor

@dengjonathan dengjonathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@marc-sift marc-sift enabled auto-merge (squash) December 12, 2025 18:22
@marc-sift marc-sift merged commit 9428386 into main Dec 12, 2025
15 checks passed
@marc-sift marc-sift deleted the cache-api-calls-during-rule-eval branch December 12, 2025 18:25
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

Successfully merging this pull request may close these issues.

2 participants