Skip to content

Improve WoT validation performance for "MergeThing" commands#2211

Merged
thjaeckle merged 4 commits intoeclipse-ditto:masterfrom
beyonnex-io:feature/improve-wot-validation-performance
Sep 1, 2025
Merged

Improve WoT validation performance for "MergeThing" commands#2211
thjaeckle merged 4 commits intoeclipse-ditto:masterfrom
beyonnex-io:feature/improve-wot-validation-performance

Conversation

@thjaeckle
Copy link
Member

  • previously, the complete thing (with all of its features) were validated against all submodels
  • this could be potentially very CPU intensive
  • even if not much was changed within a PATCH or MergeThing command, this wasted a lot of resources
  • the new approach only validates parts which were changed in the "Merge" command

E.g.:

  • if an attribute was modified, all of the attributes are validated
  • if part of a feature was modified, all properties of that feature are validated
  • if all features were modified, all properties of all features are validated (but then PATCH is not really an optimisation compared to using PUT)
  • special case: if the thing's definition was updated, the complete thing is validated as all parts have to be valid according to the updated definition

* enhancing existing span with timing information tagged by command type and namespace
@thjaeckle thjaeckle added this to the 3.8.0 milestone Aug 29, 2025
@thjaeckle thjaeckle self-assigned this Aug 29, 2025
@thjaeckle thjaeckle moved this to Waiting for Approval in Ditto Planning Aug 29, 2025
@thjaeckle
Copy link
Member Author

@alstanchev @kalinkostashki could you please have a look at this small improvement?
We have lots of CPU usage in our Ditto installation and hope to get it down by this improvement - only validating features which were contained in a MergeThing command instead of all features of the thing.

@thjaeckle thjaeckle force-pushed the feature/improve-wot-validation-performance branch from fdbea23 to 4399957 Compare September 1, 2025 08:00
@alstanchev alstanchev self-requested a review September 1, 2025 08:11
Copy link
Contributor

@alstanchev alstanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@thjaeckle thjaeckle merged commit 9e7ede2 into eclipse-ditto:master Sep 1, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from Waiting for Approval to Done in Ditto Planning Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants