Skip to content

use deferred imports for requests and pyudev#880

Merged
Emantor merged 2 commits intolabgrid-project:masterfrom
jluebbe:deferred-import
Jan 5, 2022
Merged

use deferred imports for requests and pyudev#880
Emantor merged 2 commits intolabgrid-project:masterfrom
jluebbe:deferred-import

Conversation

@jluebbe
Copy link
Copy Markdown
Member

@jluebbe jluebbe commented Jan 3, 2022

Description
Although the parts of labgrid which need requests and pyudev are not used by labgrid-client, they are still loaded every time and cause a significant startup overhead. This is especially noticeable on smaller ARM systems.

Checklist

  • PR has been tested

This matches the approach we have in other drivers already and improves the
startup time of labgrid-client by ~11%.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
This matches the approach we have in other placesalready and improves the
startup time of labgrid-client by ~5%.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 3, 2022

Codecov Report

Merging #880 (d0b73a1) into master (11609b7) will increase coverage by 0.0%.
The diff coverage is 92.8%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #880   +/-   ##
======================================
  Coverage    57.0%   57.0%           
======================================
  Files         148     148           
  Lines       10970   10973    +3     
======================================
+ Hits         6257    6260    +3     
  Misses       4713    4713           
Impacted Files Coverage Δ
labgrid/resource/lxaiobus.py 93.0% <75.0%> (+0.1%) ⬆️
labgrid/driver/lxaiobusdriver.py 88.3% <100.0%> (+0.2%) ⬆️
labgrid/resource/udev.py 48.2% <100.0%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11609b7...d0b73a1. Read the comment docs.

@Emantor Emantor merged commit 9988482 into labgrid-project:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants