Init storage at BaseScript level instead of within findstorage #11727

Closed
opened 2025-12-29 21:49:11 +01:00 by adam · 0 comments
Owner

Originally created by @bctiemann on GitHub (Oct 14, 2025).

Originally assigned to: @bctiemann on GitHub.

NetBox Edition

NetBox Community

NetBox Version

v4.4.2

Python Version

3.10

Steps to Reproduce

In the BaseStorage class, the findstorage function inits an instance of storage for every call of the function (i.e. for every script). In the case of storage backends like S3, this can add significant and linearly increasing overhead time for every script file on the page.

Expected Behavior

Constant (low) page load time on /extras/scripts/

Observed Behavior

Significant (and linearly increasing with number of script files) page load time, i.e. ~7s+ per script file

Originally created by @bctiemann on GitHub (Oct 14, 2025). Originally assigned to: @bctiemann on GitHub. ### NetBox Edition NetBox Community ### NetBox Version v4.4.2 ### Python Version 3.10 ### Steps to Reproduce In the `BaseStorage` class, the `findstorage` function inits an instance of `storage` for every call of the function (i.e. for every script). In the case of storage backends like S3, this can add significant and linearly increasing overhead time for every script file on the page. ### Expected Behavior Constant (low) page load time on `/extras/scripts/` ### Observed Behavior Significant (and linearly increasing with number of script files) page load time, i.e. ~7s+ per script file
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:49:11 +01:00
adam closed this issue 2025-12-29 21:49:11 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11727