Performance issues while replaying a script [message #1728154] |
Thu, 31 March 2016 11:54 |
Alexander Koptelov Messages: 10 Registered: December 2015 |
Junior Member |
|
|
Hi,
Recently we decided to use RCPTT to compare performance of our product installed in Eclipse 4.2 and 4.5. As a result, some operations (mainly UI related, like opening GMF diagram) were far worse with 4.5 than with 4.2.
Profiling AUT with script replaying reveals that Throwable.getStackTrace() takes much more time in 4.5 than in 4.2.
The problem is in the implementation of TeslaEventManager and ContextManagement.Context classes. When handling Display.syncExec() call TeslaEventManager.syncExecCall() adds context to the list, and TeslaEventManager.syncExecCall() removes it. In case of 4.2 remove() operation doesn't take much time since mostly there is only one context in the list, and it can be found and removed by reference equality. But in 4.5 there is an extra event handler (org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler, apart from only org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(Event) in 4.2) that also invoke Display.syncExec(). As a result, most of the time removal is performed over list containing 2 or 3 contexts. Thus search is performed basing on context stack traces, and getting stack trace is not very fast operation. Consider the amount of invocation (over 280000 in 4.5 vs 20000 in 4.2) and the performance glitch becomes obvious.
I haven't performed full analysis, but from TeslaEventManager's point of view there is no need in comparing contexts basing on stack traces -- a context is created in the 'around' advice, and exactly this instance should be removed after syncExec is done. So I'd suggest removing equals() and hashCode() from ContextManagement.Context class. Alternatively, if there are places where contexts should be definitely matched by stack traces, explicit iteration over array could be used with '==' comparison.
BTW, is it possible to minimize AUT instrumentation for performance testing? I believe the most of it is used for recording, not replaying.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02824 seconds