| Summary: | [cleanup] org.eclipse.jdt.internal.core.util.Util should not define its own sort methods | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
|
Description
Olivier Thomann
I used the following code to check the speed.
import java.util.Arrays;
import java.util.Random;
import org.eclipse.jdt.internal.core.util.Util;
public class CompareStats {
private static final int TAB_SIZE = 100000;
public static void main(String[] args) {
Random random = new Random();
int[] tab = new int[TAB_SIZE];
for (int i = 0; i < TAB_SIZE; i++) {
tab[i] = random.nextInt();
}
int[] tab2 = new int[TAB_SIZE];
System.arraycopy(tab, 0, tab2, 0, TAB_SIZE);
long time = System.currentTimeMillis();
Util.sort(tab);
System.out.println("Util.sort(...) " + (System.currentTimeMillis() - time) + "ms spent "); //$NON-NLS-1$//$NON-NLS-2$
time = System.currentTimeMillis();
Arrays.sort(tab2);
System.out.println("Arrays.sort(...) " + (System.currentTimeMillis() - time) + "ms spent "); //$NON-NLS-1$//$NON-NLS-2$
time = System.currentTimeMillis();
Util.sort(tab);
System.out.println("Util.sort(...) " + (System.currentTimeMillis() - time) + "ms spent "); //$NON-NLS-1$//$NON-NLS-2$
time = System.currentTimeMillis();
Arrays.sort(tab2);
System.out.println("Arrays.sort(...) " + (System.currentTimeMillis() - time) + "ms spent "); //$NON-NLS-1$//$NON-NLS-2$
}
}
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |