-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Startup/shutdown performance: unnecessary processing of activity events #1084
Comments
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
Thanks @HeikoKlare for working on this, improved startup performance is always welcomed. If you feel confident with your chanages, please merge them early in this release so that they get intensive usage during this development cycle. |
Thanks @vogella! I will merge the PRs soon (probably this week). I will just find someone at least having a quick look at them first. |
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
I applied both of your PRs and these are my results
Good performance improvement :-) |
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
…m#1084 The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to eclipse-platform#1084.
The ActivityPersistenceHelper persists all activity enablements upon every notification about a changed activity enablement it receives. Persistence is, however, only done and thus necessary for activities that are not expression-controlled. So the current implementation performs unnecessary persistence operations. With this change, the ActivityPersistenceHelper only persists the enablements when the enablement of a non-expression-controlled activity has changed. To this end, the received ActivityManagerEvent is extended by the information about whether such an activity was affected. This information is either directly passed to the event construction in case it has already been calculated in the calling context or is calculated lazily when accessing the value. Contributes to #1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
…pse-platform#1084 The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to eclipse-platform#1084.
The WorkbenchActivitySupport is currently disabled quite late during workbench shutdown. In particular, it is performed after the service locator disposal, which produces several events for the disablement of expression-controlled activities that are processed by the activity management. Since the activity management is shut down afterwards anyway, the processing of these events is unnecessary. This change ensures that activities enablement changes are not unnecessarily processed during workbench shutdown. It consists of two parts: 1. It performs the disposal of activity management and its persistence handler early in the workbench shutdown process (in particular before the service locator disposal). 2. It adds proper dispose functionality for the IActivityManager, such that disposing the workbench activity support disposes the activity manager, which then removes all its listeners to not react to further events. Contributes to #1084.
Thanks for that validation, @fedejeanne! |
Issue
The activity management in
MutableActivityManager
andActivityPersistenceHelper
is inefficient when dealing with higher amounts of activities. Activity enablements are unnecessarily processed and persisted upon different events:eclipse.platform.ui/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ActivityPersistanceHelper.java
Lines 60 to 62 in f4989c9
Reproduction
This unnecessary processing probably has no noticable effect in many products, as the types and amounts of activities are not high enough to produce a perceivable performance impact. In larger products this can, however, have severe impacts. In our product the effect is an overhead during startup and shutdown of the workbench of multiple seconds.
I have created a very artificial demo project with a large amount of defined activities and a large amount of enablement changes during startup/shutdown to make the impact obvious:
ManyActivitiesPerformanceDemo.zip
Evaluation
I have executed that demo with the current state of implementation and compared it to improved implementations that address the mentioned issue (can be seen in PR #1085 and #1086).
On my machine, the results with the demo project across several runs were as follows:
Startup time:
Without unnecessary persistence: 350-500 ms
With unnecessary persistence: 1500-1700 ms
Shutdown time:
With early disposal: 350-450 ms
Without proper disposal: 1300-1450 ms
How to proceed
I have started two PRs that address the mentioned issues (#1085, #1086). The changes of those PRs are the basis for the evaluation results mentioned above. In case you already see any side effects of addressing those issue that I am currently not aware of or, in general, reasons why the current behavior is required, I would be glad if you can let me know.
The text was updated successfully, but these errors were encountered: