Skip to content

Conversation

@fopina
Copy link
Owner

@fopina fopina commented Apr 6, 2025

Try dropping lazy import in favor of some other solution

on main / with lazy-import

$ for _ in $(seq 3); do python -m timeit -n 1 -r 1 'import defectdojo_api_generated'; done
1 loop, best of 1: 296 msec per loop
1 loop, best of 1: 294 msec per loop
1 loop, best of 1: 308 msec per loop

removing lazy-import changes

$ for _ in $(seq 3); do python -m timeit -n 1 -r 1 'import defectdojo_api_generated'; done
1 loop, best of 1: 6.86 sec per loop
1 loop, best of 1: 6.67 sec per loop
1 loop, best of 1: 6.46 sec per loop

after removing 1200+ calls to validate_call and using defer_build

$ for _ in $(seq 3); do python -m timeit -n 1 -r 1 'import defectdojo_api_generated'; done
1 loop, best of 1: 1.98 sec per loop
1 loop, best of 1: 1.99 sec per loop
1 loop, best of 1: 2.23 sec per loop

@codecov
Copy link

codecov bot commented Apr 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.21%. Comparing base (cee2ee1) to head (bd914ea).
Report is 7 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
- Coverage   36.72%   35.21%   -1.51%     
==========================================
  Files         371      371              
  Lines       35642    33687    -1955     
==========================================
- Hits        13089    11864    -1225     
+ Misses      22553    21823     -730     

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

@fopina fopina force-pushed the drop/lazy_import branch from daf3c7c to 4a30121 Compare April 10, 2025 00:06
@fopina fopina force-pushed the drop/lazy_import branch from 8c77f84 to 97ea607 Compare April 10, 2025 00:22
@fopina fopina merged commit ed018e3 into main Apr 10, 2025
4 of 5 checks passed
@fopina fopina deleted the drop/lazy_import branch April 10, 2025 00: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