Bug 343242 - CodeCompletionPerformanceTest#testApplicationWithParamterGuesses2() unreliable
Summary: CodeCompletionPerformanceTest#testApplicationWithParamterGuesses2() unreliable
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.8   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance, test
Depends on:
Blocks:
 
Reported: 2011-04-19 04:04 EDT by Dani Megert CLA
Modified: 2012-01-12 06:49 EST (History)
1 user (show)

See Also:


Attachments
change mentioned in comment 3 (1.18 KB, patch)
2011-05-05 04:27 EDT, Deepak Azad CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2011-04-19 04:04:49 EDT
3.7 but also on the baseline.

CodeCompletionPerformanceTest#testApplicationWithParamterGuesses2() is unreliable.

The test jumps up and down. In 3.6 it looked good.

We need to investigate why this now happens in 3.6 baseline builds and 3.7.
Comment 1 Deepak Azad CLA 2011-05-03 06:07:25 EDT
This test is unreliable only on RHEL machine. Plus CodeCompletionPerformanceTest#testApplicationWithParamterNames() is also unreliable on the same machine.

Both the tests work reliably on other 3 machines.
Comment 2 Deepak Azad CLA 2011-05-03 06:33:34 EDT
(In reply to comment #0)
> In 3.6 it looked good.
> 
> We need to investigate why this now happens in 3.6 baseline builds and 3.7.

Nope, the problem started sometime during 3.6 and that too only on RHEL.

http://archive.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/performance/eplnx2/Scenario32.html

http://archive.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/performance/eplnx2/Scenario28.html
Comment 3 Deepak Azad CLA 2011-05-05 03:08:11 EDT
For one thing CodeCompletionPerformanceTest.testApplicationWithParamterGuesses() is wrong.

In the third line the method invocation should be measureApplicationWithParamterGuesses instead of measureCompletionWithParamterNames :)

Once this method is corrected, the problem should surface in this method as well.
Comment 4 Deepak Azad CLA 2011-05-05 04:27:05 EDT
Created attachment 194802 [details]
change mentioned in comment 3

Committed the patch to HEAD.
Comment 5 Deepak Azad CLA 2011-05-05 05:18:19 EDT
(In reply to comment #4)
> Created attachment 194802 [details] [diff]
> change mentioned in comment 3
 
Committed the patch to perf_36x as well.
Comment 6 Deepak Azad CLA 2011-05-05 07:48:49 EDT
testApplicationNoParamters works fine.

The three problematic methods are -
testApplicationWithParamterNames
testApplicationWithParamterGuesses
testApplicationWithParamterGuesses2

So the problem should be either
- in the computation of parameter suggestions or 
- in showing the popup with the parameter suggestions.
Since the problem happens only on RHEL, I think it is the second.

On my RHEL machine the CPU and Elapsed process times for the three tests in question are about 9-10 seconds. On the build machine these are 12-13 seconds. However I have not been able to reproduce the variable nature of the test.

On my WinXP machine the numbers for the same three tests are 1.x seconds, i.e. similar to the numbers on the build machine.
Comment 7 Dani Megert CLA 2011-05-05 10:37:50 EDT
(In reply to comment #6)
> testApplicationNoParamters works fine.
> 
> The three problematic methods are -
> testApplicationWithParamterNames
> testApplicationWithParamterGuesses
> testApplicationWithParamterGuesses2
> 
> So the problem should be either
> - in the computation of parameter suggestions or 
> - in showing the popup with the parameter suggestions.
> Since the problem happens only on RHEL, I think it is the second.
> 
> On my RHEL machine the CPU and Elapsed process times for the three tests in
> question are about 9-10 seconds. On the build machine these are 12-13 seconds.
> However I have not been able to reproduce the variable nature of the test.
> 
> On my WinXP machine the numbers for the same three tests are 1.x seconds, i.e.
> similar to the numbers on the build machine.

Does the computation use lots of memory so that sometimes a GC happens?
Comment 8 Deepak Azad CLA 2011-05-09 02:07:25 EDT
(In reply to comment #7)
> Does the computation use lots of memory so that sometimes a GC happens?
Not particularly. I was profiling using yourkit today, there isn't much difference on Windows and Linux as far as GC is concerned.

However on Linux Shell.setVisible(boolean) takes a bit of time (this in turn calls OS._g_main_context_iteration(int,boolean) which takes most of the time in the setVisible call). On Windows, Shell.setVisible(boolean) is extremely fast.

The call to Shell.setVisible(boolean) comes from CompletionProposalPopup2.displayProposals() line 683. This method includes this comment - "// see bug 47511: setVisible may run the event loop on GTK and trigger a rentrant call - have to check whether we are still visible".
Comment 9 Deepak Azad CLA 2011-05-09 03:18:13 EDT
(In reply to comment #8)
> However on Linux Shell.setVisible(boolean) takes a bit of time (this in turn
> calls OS._g_main_context_iteration(int,boolean) which takes most of the time in
> the setVisible call). On Windows, Shell.setVisible(boolean) is extremely fast.

Filed bug 345093 for this. This explains why the test takes more time on Linux, but I still do not know the reason for the unreliable nature of the test.
Comment 10 Deepak Azad CLA 2011-05-09 05:46:58 EDT
With I20110504-0800 the test runs fast(2.24 seconds) on the build machine but on my RHEL machine it runs quite slow (11 seconds).
Comment 11 Dani Megert CLA 2011-05-10 05:58:48 EDT
We need to add tracing information so that we can see what's going on. This will need more time and we don't want to play around with the tests at this point. ==> 3.8.
Comment 12 Deepak Azad CLA 2011-10-10 02:39:45 EDT
Things look better here after bug 345093 got fixed.

I verified on my linux machine with I20111005-0925 that the CPU and Elapsed process times for the three tests in question are about 1.x second. 

Keeping this bug open till this is verified on the build machine, which may take a while as the performance tests for 3.8/4.2 are not yet running there.