Werk #18032: HW/SW Inventory: Speed up loading trees

Component HW/SW inventory
Title HW/SW Inventory: Speed up loading trees
Date May 14, 2025
Level Prominent Change
Class New Feature
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

So far the inventory trees are saved with Python's repr function and loaded with ast.literal_eval. Now new or archived trees are saved as json.

A distributed setup may be constituted of sites where remote sites use already this version and the central site still uses a 2.4.0 version. In order to make the repr vs. json inventory tree transformation work the central site must be at least of version 2.4.0p3. See also werk 18034.

A simple test shows a clear performance improvement. Loading 150 trees, each of size 1.7 MB, takes

  • 65 seconds with ast.literal_eval

  • 2 seconds with json.loads

To the list of all Werks