Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Startup Performance
Startup Performance [message #246221] Mon, 17 November 2008 14:44 Go to next message
Iwan Birrer is currently offline Iwan BirrerFriend
Messages: 6
Registered: July 2009
Junior Member
Hi All

With a growing number of edit parts (> 5000) the initialization time of a
gef editor can increase to several seconds.

After some profiling we found that a great deal of the time is taken by
the org.eclipse.draw2d.EventListenerList.addListener() class due to a
System.arraycopy() for each listener added to the list.

The attached snippets demonstrates the slow down caused by the
EventListenerList class for a growing number of edit parts by measuring
the time for EditorViewer.setContents().

2000 edit parts: 141 ms
10000 edit parts: 1828 ms
20000 edit parts: 7109 ms
40000 edit parts: 31235 ms

By removing the array copy in the EventListenerList (see attached
EventListenerList.java) and replacing the internal array with a map, we
got the following numbers:

2000 edit parts: 110 ms
10000 edit parts: 375 ms
20000 edit parts: 594 ms
40000 edit parts: 1297 ms

The performance gain is quite obvious.

It boils down to a different approach on the array copy strategy: The
attached EventListenerList implementation does the copy of the array when
iterating over the list while the draw2d/GEF version performs the copy
operation when adding a listener to the list. However the attached version
may slow down updating the edit parts/figures. Our tests with and editable
editor hasn't shown a perceivable slow down though.

We hope somebody can look at this issue and let us know if there's a
chance that the EventListenerList implementation is changed for the next
release. We can also write a bug report if needed.

Regards,
Iwan


Test environment:
- Intel Core 2, T7200 @ 2 GHz, 2 GB Ram
- JavaSE-1.6
- org.eclipse.jface 3.4.0
- org.eclipse.gef 3.4.1
- org.eclipse.core.runtime 3.4.0
- com.ibm.icu 3.8.1

To run the example just create a new Pluin project, add the dependencies
listed above to the Manifest and copy the attached
EventListenerPerformance.java. To replace the EventListenerList you need
to import the org.eclipse.draw2d plug-in into the workspace as a source
project and replace the org.eclipse.draw2d.EventListenerList class by the
one attached to this message.
Re: Startup Performance [message #246234 is a reply to message #246221] Mon, 17 November 2008 15:00 Go to previous messageGo to next message
Iwan Birrer is currently offline Iwan BirrerFriend
Messages: 6
Registered: July 2009
Junior Member
This is a multi-part message in MIME format.
--------------090301050702020400080603
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

.... and the attachments.

- Iwan

--------------090301050702020400080603
Content-Type: text/plain;
name="EventListenerList.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="EventListenerList.java"

package org.eclipse.draw2d;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
* This class is intended for internal use only. TODO: If this is for internal
* use only, we should move it to the internal package.
*/
public final class EventListenerList {

private final Map listenersMap = new HashMap();

/**
* Adds a listener of type <i>c</i> to the list.
*
* @param c
* the class
* @param listener
* the listener
*/
public synchronized void addListener(Class c, Object listener) {
if (listener == null || c == null) {
throw new IllegalArgumentException();
}

List listeners = (List) listenersMap.get(c);
if (listeners == null) {
listeners = new ArrayList(2);
listenersMap.put(c, listeners);
}

listeners.add(listener);
}

/**
* Returns <code>true</code> if this list of listeners contains a listener
* of type <i>c</i>.
*
* @param c
* the type
* @return whether this list contains a listener of type <i>c</i>
*/
public synchronized boolean containsListener(Class c) {
return listenersMap.containsKey(c);
}

/**
* Returns an Iterator of all the listeners of type <i>c</i>.
*
* @param listenerType
* the type
* @return an Iterator of all the listeners of type <i>c</i>
*/
public synchronized Iterator getListeners(final Class listenerType) {
if (listenersMap.get(listenerType) != null) {
return new ArrayList(((List) listenersMap.get(listenerType)))
.iterator();
}
return Collections.EMPTY_LIST.iterator();
}

/**
* Removes the first <i>listener</i> of the specified type by identity.
*
* @param c
* the type
* @param listener
* the listener
*/
public synchronized void removeListener(Class c, Object listener) {
if (listener == null || c == null) {
throw new IllegalArgumentException();
}

List listeners = (List) listenersMap.get(c);
if (listeners != null) {
listeners.remove(listener);
}
}

}

--------------090301050702020400080603
Content-Type: text/plain;
name="EventListenerPerformance.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="EventListenerPerformance.java"

package ch.there.diagramxy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.FreeformLayer;
import org.eclipse.draw2d.FreeformLayout;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class EventListenerPerformance {

// Edit parts ===========================

static class DiagramEditPart extends AbstractGraphicalEditPart {

public DiagramEditPart(Diagram diagram) {
setModel(diagram);
}

private Diagram getDiagram() {
return (Diagram) getModel();
}

@Override
protected IFigure createFigure() {
FreeformLayer layer = new FreeformLayer();
layer.setLayoutManager(new FreeformLayout());
layer.setBorder(new LineBorder(1));
return layer;
}

@Override
protected void createEditPolicies() {
}

@Override
protected List<Line> getModelChildren() {
return new ArrayList<Line>(getDiagram().getLines());
}
}

static class LineEditPart extends AbstractGraphicalEditPart {

public LineEditPart(Line line) {
setModel(line);
}

@Override
protected IFigure createFigure() {
FreeformLayer layer = new FreeformLayer();
layer.setLayoutManager(new FreeformLayout());
return layer;
}

private Line getLine() {
return (Line) getModel();
}

@Override
protected void createEditPolicies() {

}

@Override
protected List<Point> getModelChildren() {
return getLine().getPoints();
}
}

static class PointEditPart extends AbstractGraphicalEditPart {

public PointEditPart(Point point) {
setModel(point);
}

@Override
protected IFigure createFigure() {
RectangleFigure fig = new RectangleFigure();
return fig;
}

private Point getPoint() {
return (Point) getModel();
}

@Override
protected void refreshVisuals() {
RectangleFigure figure = (RectangleFigure) getFigure();
figure.setPreferredSize(3, 3);
LineEditPart parent = (LineEditPart) getParent();
parent.setLayoutConstraint(this, figure, new Rectangle(getPoint()
.getX(), getPoint().getY(), -1, -1));
}

@Override
protected void createEditPolicies() {
}

@Override
public List<Connection> getModelSourceConnections() {
Connection connection = getPoint().getSourceConnection();
if (connection == null) {
return Collections.emptyList();
}
List<Connection> list = new ArrayList<Connection>(1);
list.add(connection);
return list;
}

@Override
public List<Connection> getModelTargetConnections() {
Connection connection = getPoint().getTargetConnection();
if (connection == null) {
return Collections.emptyList();
}
List<Connection> list = new ArrayList<Connection>(1);
list.add(connection);
return list;
}
}

static class ConnectionEditPart extends AbstractConnectionEditPart {

public ConnectionEditPart(Connection connection) {
setModel(connection);
}

@Override
protected IFigure createFigure() {
PolylineConnection connection = (PolylineConnection) super
.createFigure();
return connection;
}

@Override
protected void createEditPolicies() {
}
}

// Edit Part Factory ==========================================

static class DiagramEditPartFactory implements EditPartFactory {

private int editPartCount = 0;

@Override
public EditPart createEditPart(EditPart context, Object model) {
editPartCount++;
if (model instanceof Diagram) {
return new DiagramEditPart((Diagram) model);
} else if (model instanceof Line) {
return new LineEditPart((Line) model);
} else if (model instanceof Point) {
return new PointEditPart((Point) model);
} else if (model instanceof Connection) {
return new ConnectionEditPart((Connection) model);
}
return null;
}

/**
* Clears the edit part count.
*
* @return the previous value of {@link #editPartCount}.
*/
int clearEditPartCount() {
int oldValue = editPartCount;
this.editPartCount = 0;
return oldValue;
}
}

// Figures ====================================================

static class LineFigure extends Figure {
private final RectangleFigure rectangle;

public LineFigure() {
setLayoutManager(new XYLayout());
rectangle = new RectangleFigure();
add(rectangle);
}

@Override
protected void paintFigure(Graphics graphics) {
setConstraint(rectangle, new Rectangle(0, 0, 10, 10));
rectangle.invalidate();
}
}

static class PointFigure extends Figure {
private final RectangleFigure rectangle;

public PointFigure() {
setLayoutManager(new XYLayout());
rectangle = new RectangleFigure();
add(rectangle);
}

@Override
protected void paintFigure(Graphics graphics) {
setConstraint(rectangle, new Rectangle(0, 0, 3, 3));
rectangle.invalidate();
}
}

// Model ======================================================

static class Diagram {
private final Set<Line> lines = new HashSet<Line>();

public void addLine(Line line) {
lines.add(line);
}

public void removeLine(Line line) {
lines.remove(line);
}

public Set<Line> getLines() {
return lines;
}
}

static public class Line {
private final List<Point> points;

public Line(List<Point> points) {
this.points = Collections.unmodifiableList(new ArrayList<Point>(
points));
}

public List<Point> getPoints() {
return points;
}
}

static class Point {
private int x;
private int y;
private Connection sourceConnection;
private Connection targetConnection;

public Point(int x, int y) {
this.x = x;
this.y = y;
}

public int getX() {
return x;
}

public void setX(int x) {
this.x = x;
}

public int getY() {
return y;
}

public void setY(int y) {
this.y = y;
}

public Connection getSourceConnection() {
return sourceConnection;
}

public void setSourceConnection(Connection sourceConnection) {
this.sourceConnection = sourceConnection;
}

public Connection getTargetConnection() {
return targetConnection;
}

public void setTargetConnection(Connection targetConnection) {
this.targetConnection = targetConnection;
}
}

static class Connection {
private final Point source, target;

public Connection(Point source, Point target) {
if (source == null || target == null) {
throw new IllegalArgumentException("null not allowed");
}

this.source = source;
this.target = target;

this.source.setSourceConnection(this);
this.target.setTargetConnection(this);
}

public Point getSource() {
return source;
}

public Point getTarget() {
return target;
}
}

// Main ============================================================ =

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);

ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
viewer.createControl(shell);
shell.setLayout(new FillLayout());
viewer.setRootEditPart(new ScalableFreeformRootEditPart());
viewer.getControl().setBackground(ColorConstants.white);

DiagramEditPartFactory editPartFactory = new DiagramEditPartFactory();
viewer.setEditPartFactory(editPartFactory);

setContents(viewer, editPartFactory, 10, 100);
setContents(viewer, editPartFactory, 50, 100);
setContents(viewer, editPartFactory, 100, 100);
setContents(viewer, editPartFactory, 200, 100);

shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}

private static void setContents(ScrollingGraphicalViewer viewer,
DiagramEditPartFactory editPartFactory, int lineCount,
int pointCount) {
viewer.setContents(null);
Diagram diagram = new Diagram();
for (int i = 0; i < lineCount; i++) {
List<Point> points = new ArrayList<Point>();
Point lastPoint = null;
for (int j = 0; j < pointCount; j++) {
Point point = new Point(j * 20, i * 12 + j * 10);
if (lastPoint != null) {
new Connection(lastPoint, point);
}
points.add(point);
lastPoint = point;
}
diagram.addLine(new Line(points));
}
Diagram model = diagram;
long start = System.currentTimeMillis();
viewer.setContents(model);
System.out.println(editPartFactory.clearEditPartCount()
+ " edit parts: " + (System.currentTimeMillis() - start)
+ " ms");
}
}

--------------090301050702020400080603--
Re: Startup Performance [message #246246 is a reply to message #246234] Mon, 17 November 2008 15:48 Go to previous messageGo to next message
Anthony Hunter is currently offline Anthony HunterFriend
Messages: 446
Registered: July 2009
Senior Member
Hi Iwan,

Can you cut and paste this entire thread into a Bugzilla?

Cheers...
Anthony

"Iwan Birrer" <iwanbirrer@bluewin.ch> wrote in message
news:gfs0tm$8j3$1@build.eclipse.org...
> ... and the attachments.
>
> - Iwan
>


------------------------------------------------------------ --------------------


> package org.eclipse.draw2d;
>
> import java.util.ArrayList;
> import java.util.Collections;
> import java.util.HashMap;
> import java.util.Iterator;
> import java.util.List;
> import java.util.Map;
>
> /**
> * This class is intended for internal use only. TODO: If this is for
> internal
> * use only, we should move it to the internal package.
> */
> public final class EventListenerList {
>
> private final Map listenersMap = new HashMap();
>
> /**
> * Adds a listener of type <i>c</i> to the list.
> *
> * @param c
> * the class
> * @param listener
> * the listener
> */
> public synchronized void addListener(Class c, Object listener) {
> if (listener == null || c == null) {
> throw new IllegalArgumentException();
> }
>
> List listeners = (List) listenersMap.get(c);
> if (listeners == null) {
> listeners = new ArrayList(2);
> listenersMap.put(c, listeners);
> }
>
> listeners.add(listener);
> }
>
> /**
> * Returns <code>true</code> if this list of listeners contains a listener
> * of type <i>c</i>.
> *
> * @param c
> * the type
> * @return whether this list contains a listener of type <i>c</i>
> */
> public synchronized boolean containsListener(Class c) {
> return listenersMap.containsKey(c);
> }
>
> /**
> * Returns an Iterator of all the listeners of type <i>c</i>.
> *
> * @param listenerType
> * the type
> * @return an Iterator of all the listeners of type <i>c</i>
> */
> public synchronized Iterator getListeners(final Class listenerType) {
> if (listenersMap.get(listenerType) != null) {
> return new ArrayList(((List) listenersMap.get(listenerType)))
> .iterator();
> }
> return Collections.EMPTY_LIST.iterator();
> }
>
> /**
> * Removes the first <i>listener</i> of the specified type by identity.
> *
> * @param c
> * the type
> * @param listener
> * the listener
> */
> public synchronized void removeListener(Class c, Object listener) {
> if (listener == null || c == null) {
> throw new IllegalArgumentException();
> }
>
> List listeners = (List) listenersMap.get(c);
> if (listeners != null) {
> listeners.remove(listener);
> }
> }
>
> }
>


------------------------------------------------------------ --------------------


> package ch.there.diagramxy;
>
> import java.util.ArrayList;
> import java.util.Collections;
> import java.util.HashSet;
> import java.util.List;
> import java.util.Set;
>
> import org.eclipse.draw2d.ColorConstants;
> import org.eclipse.draw2d.Figure;
> import org.eclipse.draw2d.FreeformLayer;
> import org.eclipse.draw2d.FreeformLayout;
> import org.eclipse.draw2d.Graphics;
> import org.eclipse.draw2d.IFigure;
> import org.eclipse.draw2d.LineBorder;
> import org.eclipse.draw2d.PolylineConnection;
> import org.eclipse.draw2d.RectangleFigure;
> import org.eclipse.draw2d.XYLayout;
> import org.eclipse.draw2d.geometry.Rectangle;
> import org.eclipse.gef.EditPart;
> import org.eclipse.gef.EditPartFactory;
> import org.eclipse.gef.editparts.AbstractConnectionEditPart;
> import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
> import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
> import org.eclipse.gef.ui.parts.ScrollingGraphicalViewer;
> import org.eclipse.swt.layout.FillLayout;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class EventListenerPerformance {
>
> // Edit parts ===========================
>
> static class DiagramEditPart extends AbstractGraphicalEditPart {
>
> public DiagramEditPart(Diagram diagram) {
> setModel(diagram);
> }
>
> private Diagram getDiagram() {
> return (Diagram) getModel();
> }
>
> @Override
> protected IFigure createFigure() {
> FreeformLayer layer = new FreeformLayer();
> layer.setLayoutManager(new FreeformLayout());
> layer.setBorder(new LineBorder(1));
> return layer;
> }
>
> @Override
> protected void createEditPolicies() {
> }
>
> @Override
> protected List<Line> getModelChildren() {
> return new ArrayList<Line>(getDiagram().getLines());
> }
> }
>
> static class LineEditPart extends AbstractGraphicalEditPart {
>
> public LineEditPart(Line line) {
> setModel(line);
> }
>
> @Override
> protected IFigure createFigure() {
> FreeformLayer layer = new FreeformLayer();
> layer.setLayoutManager(new FreeformLayout());
> return layer;
> }
>
> private Line getLine() {
> return (Line) getModel();
> }
>
> @Override
> protected void createEditPolicies() {
>
> }
>
> @Override
> protected List<Point> getModelChildren() {
> return getLine().getPoints();
> }
> }
>
> static class PointEditPart extends AbstractGraphicalEditPart {
>
> public PointEditPart(Point point) {
> setModel(point);
> }
>
> @Override
> protected IFigure createFigure() {
> RectangleFigure fig = new RectangleFigure();
> return fig;
> }
>
> private Point getPoint() {
> return (Point) getModel();
> }
>
> @Override
> protected void refreshVisuals() {
> RectangleFigure figure = (RectangleFigure) getFigure();
> figure.setPreferredSize(3, 3);
> LineEditPart parent = (LineEditPart) getParent();
> parent.setLayoutConstraint(this, figure, new Rectangle(getPoint()
> .getX(), getPoint().getY(), -1, -1));
> }
>
> @Override
> protected void createEditPolicies() {
> }
>
> @Override
> public List<Connection> getModelSourceConnections() {
> Connection connection = getPoint().getSourceConnection();
> if (connection == null) {
> return Collections.emptyList();
> }
> List<Connection> list = new ArrayList<Connection>(1);
> list.add(connection);
> return list;
> }
>
> @Override
> public List<Connection> getModelTargetConnections() {
> Connection connection = getPoint().getTargetConnection();
> if (connection == null) {
> return Collections.emptyList();
> }
> List<Connection> list = new ArrayList<Connection>(1);
> list.add(connection);
> return list;
> }
> }
>
> static class ConnectionEditPart extends AbstractConnectionEditPart {
>
> public ConnectionEditPart(Connection connection) {
> setModel(connection);
> }
>
> @Override
> protected IFigure createFigure() {
> PolylineConnection connection = (PolylineConnection) super
> .createFigure();
> return connection;
> }
>
> @Override
> protected void createEditPolicies() {
> }
> }
>
> // Edit Part Factory ==========================================
>
> static class DiagramEditPartFactory implements EditPartFactory {
>
> private int editPartCount = 0;
>
> @Override
> public EditPart createEditPart(EditPart context, Object model) {
> editPartCount++;
> if (model instanceof Diagram) {
> return new DiagramEditPart((Diagram) model);
> } else if (model instanceof Line) {
> return new LineEditPart((Line) model);
> } else if (model instanceof Point) {
> return new PointEditPart((Point) model);
> } else if (model instanceof Connection) {
> return new ConnectionEditPart((Connection) model);
> }
> return null;
> }
>
> /**
> * Clears the edit part count.
> *
> * @return the previous value of {@link #editPartCount}.
> */
> int clearEditPartCount() {
> int oldValue = editPartCount;
> this.editPartCount = 0;
> return oldValue;
> }
> }
>
> // Figures ====================================================
>
> static class LineFigure extends Figure {
> private final RectangleFigure rectangle;
>
> public LineFigure() {
> setLayoutManager(new XYLayout());
> rectangle = new RectangleFigure();
> add(rectangle);
> }
>
> @Override
> protected void paintFigure(Graphics graphics) {
> setConstraint(rectangle, new Rectangle(0, 0, 10, 10));
> rectangle.invalidate();
> }
> }
>
> static class PointFigure extends Figure {
> private final RectangleFigure rectangle;
>
> public PointFigure() {
> setLayoutManager(new XYLayout());
> rectangle = new RectangleFigure();
> add(rectangle);
> }
>
> @Override
> protected void paintFigure(Graphics graphics) {
> setConstraint(rectangle, new Rectangle(0, 0, 3, 3));
> rectangle.invalidate();
> }
> }
>
> // Model ======================================================
>
> static class Diagram {
> private final Set<Line> lines = new HashSet<Line>();
>
> public void addLine(Line line) {
> lines.add(line);
> }
>
> public void removeLine(Line line) {
> lines.remove(line);
> }
>
> public Set<Line> getLines() {
> return lines;
> }
> }
>
> static public class Line {
> private final List<Point> points;
>
> public Line(List<Point> points) {
> this.points = Collections.unmodifiableList(new ArrayList<Point>(
> points));
> }
>
> public List<Point> getPoints() {
> return points;
> }
> }
>
> static class Point {
> private int x;
> private int y;
> private Connection sourceConnection;
> private Connection targetConnection;
>
> public Point(int x, int y) {
> this.x = x;
> this.y = y;
> }
>
> public int getX() {
> return x;
> }
>
> public void setX(int x) {
> this.x = x;
> }
>
> public int getY() {
> return y;
> }
>
> public void setY(int y) {
> this.y = y;
> }
>
> public Connection getSourceConnection() {
> return sourceConnection;
> }
>
> public void setSourceConnection(Connection sourceConnection) {
> this.sourceConnection = sourceConnection;
> }
>
> public Connection getTargetConnection() {
> return targetConnection;
> }
>
> public void setTargetConnection(Connection targetConnection) {
> this.targetConnection = targetConnection;
> }
> }
>
> static class Connection {
> private final Point source, target;
>
> public Connection(Point source, Point target) {
> if (source == null || target == null) {
> throw new IllegalArgumentException("null not allowed");
> }
>
> this.source = source;
> this.target = target;
>
> this.source.setSourceConnection(this);
> this.target.setTargetConnection(this);
> }
>
> public Point getSource() {
> return source;
> }
>
> public Point getTarget() {
> return target;
> }
> }
>
> // Main ============================================================ =
>
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
>
> ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
> viewer.createControl(shell);
> shell.setLayout(new FillLayout());
> viewer.setRootEditPart(new ScalableFreeformRootEditPart());
> viewer.getControl().setBackground(ColorConstants.white);
>
> DiagramEditPartFactory editPartFactory = new DiagramEditPartFactory();
> viewer.setEditPartFactory(editPartFactory);
>
> setContents(viewer, editPartFactory, 10, 100);
> setContents(viewer, editPartFactory, 50, 100);
> setContents(viewer, editPartFactory, 100, 100);
> setContents(viewer, editPartFactory, 200, 100);
>
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
>
> private static void setContents(ScrollingGraphicalViewer viewer,
> DiagramEditPartFactory editPartFactory, int lineCount,
> int pointCount) {
> viewer.setContents(null);
> Diagram diagram = new Diagram();
> for (int i = 0; i < lineCount; i++) {
> List<Point> points = new ArrayList<Point>();
> Point lastPoint = null;
> for (int j = 0; j < pointCount; j++) {
> Point point = new Point(j * 20, i * 12 + j * 10);
> if (lastPoint != null) {
> new Connection(lastPoint, point);
> }
> points.add(point);
> lastPoint = point;
> }
> diagram.addLine(new Line(points));
> }
> Diagram model = diagram;
> long start = System.currentTimeMillis();
> viewer.setContents(model);
> System.out.println(editPartFactory.clearEditPartCount()
> + " edit parts: " + (System.currentTimeMillis() - start)
> + " ms");
> }
> }
>
Re: Startup Performance [message #246256 is a reply to message #246246] Mon, 17 November 2008 16:33 Go to previous messageGo to next message
Iwan Birrer is currently offline Iwan BirrerFriend
Messages: 6
Registered: July 2009
Junior Member
Anthony Hunter wrote:
> Hi Iwan,
>
> Can you cut and paste this entire thread into a Bugzilla?

https://bugs.eclipse.org/bugs/show_bug.cgi?id=255534

Regards,
Iwan
Re: Startup Performance [message #246271 is a reply to message #246221] Tue, 18 November 2008 04:47 Go to previous message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

This is a very nice approach and should be used throughout the Eclipse SDK..,
Previous Topic:Chaining commands
Next Topic:Viewer preferences
Goto Forum:
  


Current Time: Fri Nov 08 23:43:14 GMT 2024

Powered by FUDForum. Page generated in 0.02936 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top