| Summary: | [otre] avoid performance penalty due to eager creation of _OT$roleSet | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Objectteams | Reporter: | Stephan Herrmann <stephan.herrmann> | ||||
| Component: | OTJ | Assignee: | Stephan Herrmann <stephan.herrmann> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | exelnet | ||||
| Version: | 2.0 | ||||||
| Target Milestone: | 2.1 M2 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Stephan Herrmann
Here's a test program I used for ad-hoc micro-measurements:
public team class TeamClass {
protected class R playedBy BaseClass { }
}
public class BaseClass {
static int N=10000;
static int R=100;
public static void main(String[] args) {
new TeamClass().activate(); // but no callin!
long accu = 0L;
for (int r=0;r<R; r++) {
BaseClass bs[] = new BaseClass[N];
long start = System.nanoTime();
for (int i=0; i<N; i++)
bs[i] = new BaseClass();
if (r < 10) continue; // warm-up, don't count
long duration = System.nanoTime()-start;
System.out.println("Duration = "+duration);
accu += duration;
}
System.out.println("Mean="+(accu/(R-10)));
}
}
Preliminary results show a 3.5 speedup by avoiding the instantiation of
the role set.
Currently running the full OTJLD test suite to validate the change.
Created attachment 201836 [details]
Fix by deletion
It seems to be as easy as that: just delete the block creating
the instantiation instructions.
All OTJLD tests pass with this patch.
Patch has been committed for 2.1M2 (r1907). Verified for 2.1 by inspecting the generated byte code. |