Fixes #20660: Optimize loading of custom script modules from remote storage #890

Closed
opened 2026-04-05 18:34:31 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jeremystretch on 11/10/2025

Fixes: #20660

  • Tweak exec_module() to avoid forcing the creation of a new storage connection on each call
  • Convert module_scripts to a cached property, to avoid triggering a new fetch for each script within a module file

Some quick testing using three modules comprising five total scripts shows total rendering time for the script list view reduced from ~4.15s to ~0.80s. There is still some linear increment per script module, as each file must be fetched from remote storage, but it should be greatly reduced.

*Originally created by @jeremystretch on 11/10/2025* ### Fixes: #20660 - Tweak `exec_module()` to avoid forcing the creation of a new storage connection on each call - Convert `module_scripts` to a cached property, to avoid triggering a new fetch for each script within a module file Some quick testing using three modules comprising five total scripts shows total rendering time for the script list view reduced from ~4.15s to ~0.80s. There is still some linear increment per script module, as each file must be fetched from remote storage, but it should be greatly reduced.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#890