Skip to content

Conversation

@eandersson
Copy link
Contributor

The current logging isn't lazy-loaded. This means that all statements are evaluated even with logging disabled. This can have pretty a measurable impact on performance.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 18, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: eandersson / name: Erik Olof Gunnar Andersson (897c4f1)

@nosammai
Copy link

Testing with the provided benchmark, this makes a huge difference in performance:

Before fix:

❯ python3.8 benches/large_resource_set.py TagAssetBenchmark
Filter    : resource["IamInstanceProfile"]["Arn"].matches("(.*)(?=Enterprise-Reserved-CloudCustodian.*)") && (resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"] != "CLOUDCUSTODIAN" && resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"] != "CLOUDCORESERVICES" && present(resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"]))
Resources : 1,000
Total Time: 19,423.9 ms
Range : 13.0 ms - 172.3 ms
Mean  : 19.19 ms
Median: 15.52 ms

After Fix:

❯ python3.8 benches/large_resource_set.py TagAssetBenchmark
Filter    : resource["IamInstanceProfile"]["Arn"].matches("(.*)(?=Enterprise-Reserved-CloudCustodian.*)") && (resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"] != "CLOUDCUSTODIAN" && resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"] != "CLOUDCORESERVICES" && present(resource["Tags"].filter(x, x["Key"] == "ASSET")[0]["Value"]))
Resources : 1,000
Total Time: 2,690.9 ms
Range : 2.0 ms - 8.9 ms
Mean  : 2.60 ms
Median: 2.45 ms

@eandersson eandersson closed this Aug 31, 2022
@eandersson eandersson reopened this Aug 31, 2022
@eandersson
Copy link
Contributor Author

Had to close and re-open PR to fix issues with SLA not being recognized.

Copy link
Collaborator

@kapilt kapilt left a comment

Choose a reason for hiding this comment

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

lgtm

@kapilt
Copy link
Collaborator

kapilt commented Sep 2, 2022

looks like one test failure on test_trace_decorator to address.

@eandersson
Copy link
Contributor Author

looks like one test failure on test_trace_decorator to address.

Ops. Missed that one. Fixed.

@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (6622fe6) compared to base (50f9e8b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #36   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines         2602      2601    -1     
=========================================
- Hits          2602      2601    -1     
Impacted Files Coverage Δ
src/celpy/__init__.py 100.00% <100.00%> (ø)
src/celpy/__main__.py 100.00% <100.00%> (ø)
src/celpy/celtypes.py 100.00% <100.00%> (ø)
src/celpy/evaluation.py 100.00% <100.00%> (ø)
src/xlate/c7n_to_cel.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kapilt kapilt merged commit 6631083 into cloud-custodian:master Sep 9, 2022
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.

3 participants