Bug 550663 - FilterService.sortFilters is called too often
Summary: FilterService.sortFilters is called too often
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 6.2.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-09-02 10:05 EDT by Pierre Guilet CLA
Modified: 2019-10-04 11:21 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2019-09-02 10:05:37 EDT
When using a tool, for each diagram element on the diagram the method FilterService.sortFilters is called. This produces performance issues with big diagram.

Thread [main] (Suspended (breakpoint at line 72 in FilterService))	
	FilterService.getAppliedFilters(DDiagram, DDiagramElement) line: 72	
	CompositeFilterApplicationBuilder.computeCompositeFilterApplications() line: 62	
	FilterListener$FilteredElementsUpdateCommand.doExecute() line: 151	
	FilterListener$FilteredElementsUpdateCommand(RecordingCommand).execute() line: 135	
	CompoundCommand.execute() line: 261	
	TriggerCommand.execute() line: 113	
	SemanticEditingDomainFactory$SemanticCommandStack(WorkspaceCommandStackImpl).executeTriggers(Command, List, Map) line: 312	
	SemanticEditingDomainFactory$SemanticEditingDomain(TransactionalEditingDomainImpl).precommit(InternalTransaction) line: 712	
	TransactionImpl.commit() line: 414	
	GMFCommandWrapper(AbstractEMFOperation).execute(IProgressMonitor, IAdaptable) line: 155	
	CompositeCommand.doExecuteWithResult(IProgressMonitor, IAdaptable) line: 403	
	CompositeCommand(AbstractCommand).execute(IProgressMonitor, IAdaptable) line: 134	
	WrappingCommandIgnoringAffectedFiles.execute(IProgressMonitor, IAdaptable) line: 125	
	DefaultOperationHistory.execute(IUndoableOperation, IProgressMonitor, IAdaptable) line: 495	
	DDiagramCommandStack.execute(ICommand, IProgressMonitor) line: 73	
	DDiagramCommandStack.execute(Command, IProgressMonitor) line: 54	
	DDiagramCommandStack(DiagramCommandStack).execute(Command) line: 156	
	CreationTool(AbstractTool).executeCommand(Command) line: 425	
	CreationTool(AbstractTool).executeCurrentCommand() line: 438	
	CreationTool(CreationTool).performCreation(int) line: 269	
	CreationTool(CreationTool).handleButtonUp(int) line: 189	
	CreationTool(AbstractTool).mouseUp(MouseEvent, EditPartViewer) line: 1200	
	DiagramEditDomain(EditDomain).mouseUp(MouseEvent, EditPartViewer) line: 301	

The solution is to sort activated filters each time a new one is added only once.

Steps to reproduce:

Using family exemple, put a breakpoint in FilterService.sortFilters.
Then use the man creation tool in a diagram to add a new man.

KO you see that the sorting method is called for each diagram element in calling stack of org.eclipse.sirius.diagram.ui.business.api.helper.graphicalfilters.CompositeFilterApplicationBuilder.computeCompositeFilterApplications()
Comment 1 Eclipse Genie CLA 2019-09-02 10:14:42 EDT
New Gerrit change created: https://git.eclipse.org/r/148723