Improving performance of posting a comment by reducing memory + CPU
What does this MR do?
In the current implementation after saving a note the getter cache is invalidated 6 times. With the changes of this MR it is reduced to at most 4 as we do Object.assign instead of slice so if nothing changed on a specific note, nothing happens. At the moment even exactly the same object will cause a full invalidation as the old object is sliced out. This should reduce through less cache invalidations the memory spike + according CPU cycles.
Are there points in the code the reviewer needs to double check?
Is everything still working as expected?
Why was this MR needed?
Reduce the memory spike after posting a new note.
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - Conforms to the code review guidelines
-
Has been reviewed by a Frontend maintainer
-
-
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Edited by Tim Zallmann