Skip to content

Load MANUFDB lazily - #5203

Open
frenck wants to merge 1 commit into
secdev:masterfrom
frenck:lazy-manufdb
Open

frenck wants to merge 1 commit into
secdev:masterfrom
frenck:lazy-manufdb

Conversation

@frenck

@frenck frenck commented Sep 27, 2026 •

Copy link
Copy Markdown

Description

scapy.data loaded the manuf database at import time, which takes about 12 MiB of memory even when it is never used. Load it on first access through a module getattr instead.

AI-Assisted: yes

This change will reduce the memory footprint of Home Assistant with 10+MiB basically for free; which in today's memory crisis, is a quick but big win.

../Frenck

                       

Blogging my personal ramblings at frenck.dev

scapy.data loaded the manuf database at import time, which takes about
12 MiB of memory even when it is never used. Load it on first access
through a module __getattr__ instead.

AI-Assisted: yes
@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.17%. Comparing base (c5e9a5b) to head (6843050).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5203   +/-   ##
=======================================
  Coverage   81.16%   81.17%           
=======================================
  Files         393      393           
  Lines       98107    98114    +7     
=======================================
+ Hits        79629    79640   +11     
+ Misses      18478    18474    -4     
Files with missing lines Coverage Δ
scapy/all.py 100.00% <100.00%> (ø)
scapy/data.py 90.74% <100.00%> (+0.14%) ⬆️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant