#2139 improved the execution time of integration tests by caching standard libraries.
@pcdavid also investigated how the disposal of EditingContext (done after each test) was impacting the performances of integration tests.
When an EditingContext is disposed, its ChangeRecorder is disposed and all the Resources contained in the EditingContext are unloaded.
These operations can be costly on large models, while, in the context of SysON, it does not bring any benefit (the EditingContext is garbage collected right after its disposal).
In addition, the mandatory unload of all the resources is the reason why we have a dedicated service to cache standard libraries after each test. If there was no unload, there wouldn't be any need for this class, as standard libraries could be cached right after being loaded.
Note that the need for this unload call has been discussed in Sirius Web, but additional discussions may be interesting now that we have a concrete case where the unload call is impacting performances.
Setup:
- On his machine:
Copied all default libraries in the editing context in 302 ms (which is more or less 2 times faster than on the CI)
- Java 25.0.2 (Temurin)
Minimal project (109799 objects)
EditingContext.dispose: change recorder disposal: 24 ms; resources disposal: 223 ms
EditingContext.dispose: change recorder disposal: 16 ms; resources disposal: 150 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 140 ms
EditingContext.dispose: change recorder disposal: 11 ms; resources disposal: 211 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 145 ms
EditingContext.dispose: change recorder disposal: 24 ms; resources disposal: 130 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 127 ms
EditingContext.dispose: change recorder disposal: 8 ms; resources disposal: 130 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 144 ms
EditingContext.dispose: change recorder disposal: 11 ms; resources disposal: 153 ms
Batmobile (110510 objects: +711)
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 137 ms
EditingContext.dispose: change recorder disposal: 16 ms; resources disposal: 234 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 142 ms
EditingContext.dispose: change recorder disposal: 14 ms; resources disposal: 159 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 218 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 140 ms
EditingContext.dispose: change recorder disposal: 15 ms; resources disposal: 152 ms
EditingContext.dispose: change recorder disposal: 8 ms; resources disposal: 138 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 196 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 150 ms
Based on these numbers, we can expect ~200ms of improvement by removing the unload call (on @pcdavid's computer).
This means around 2.5 minutes for the whole test suite (820 tests), which may correspond to 4-5 minutes on the CI.
#2139 improved the execution time of integration tests by caching standard libraries.
@pcdavid also investigated how the disposal of
EditingContext(done after each test) was impacting the performances of integration tests.When an
EditingContextis disposed, itsChangeRecorderis disposed and all theResourcescontained in theEditingContextare unloaded.These operations can be costly on large models, while, in the context of SysON, it does not bring any benefit (the
EditingContextis garbage collected right after its disposal).In addition, the mandatory
unloadof all the resources is the reason why we have a dedicated service to cache standard libraries after each test. If there was no unload, there wouldn't be any need for this class, as standard libraries could be cached right after being loaded.Note that the need for this
unloadcall has been discussed in Sirius Web, but additional discussions may be interesting now that we have a concrete case where the unload call is impacting performances.Setup:
Copied all default libraries in the editing context in 302 ms(which is more or less 2 times faster than on the CI)Minimal project (109799 objects)
EditingContext.dispose: change recorder disposal: 24 ms; resources disposal: 223 ms
EditingContext.dispose: change recorder disposal: 16 ms; resources disposal: 150 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 140 ms
EditingContext.dispose: change recorder disposal: 11 ms; resources disposal: 211 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 145 ms
EditingContext.dispose: change recorder disposal: 24 ms; resources disposal: 130 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 127 ms
EditingContext.dispose: change recorder disposal: 8 ms; resources disposal: 130 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 144 ms
EditingContext.dispose: change recorder disposal: 11 ms; resources disposal: 153 ms
Batmobile (110510 objects: +711)
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 137 ms
EditingContext.dispose: change recorder disposal: 16 ms; resources disposal: 234 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 142 ms
EditingContext.dispose: change recorder disposal: 14 ms; resources disposal: 159 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 218 ms
EditingContext.dispose: change recorder disposal: 9 ms; resources disposal: 140 ms
EditingContext.dispose: change recorder disposal: 15 ms; resources disposal: 152 ms
EditingContext.dispose: change recorder disposal: 8 ms; resources disposal: 138 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 196 ms
EditingContext.dispose: change recorder disposal: 10 ms; resources disposal: 150 ms
Based on these numbers, we can expect ~200ms of improvement by removing the unload call (on @pcdavid's computer).
This means around 2.5 minutes for the whole test suite (820 tests), which may correspond to 4-5 minutes on the CI.