Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] CDT Build console speed up

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.26
diff -u -r1.26 ChangeLog
--- ChangeLog	18 Nov 2002 15:52:13 -0000	1.26
+++ ChangeLog	20 Nov 2002 14:13:18 -0000
@@ -1,3 +1,9 @@
+2002-11-20 David Inglis
+	* src/.../internal/ui/BuildConsoleManager.java
+	Only flush the console when buffer > 512 instead of every line.
+	Plus do the console update synchronously as a async update can
+	cause problems if the update happen faster then the drawing.
+	
 2002-11-18 Alain Magloire

 	* src/.../internal/ui/editor/CEditor.java (createCSourceViewer):
Index: src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java,v
retrieving revision 1.1
diff -u -r1.1 BuildConsoleManager.java
--- src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java	29 Oct 2002 21:40:58 -0000	1.1
+++ src/org/eclipse/cdt/internal/ui/BuildConsoleManager.java	20 Nov 2002 14:13:18 -0000
@@ -70,20 +70,25 @@
 			return fDocument;
 		}

-		public synchronized void flush() throws IOException {
-			super.flush();
-			Display.getDefault().asyncExec(new Runnable() {
-				public void run() {
-					if (CPluginPreferencePage.isConsoleOnTop())
-						bringConsoleOnTop();
-					try {
-						int len = fDocument.getLength();
-						fDocument.replace(len, 0, readBuffer());
-					}
-					catch (BadLocationException x) {
+		public void flush() throws IOException {
+			flush(false);
+		}
+		
+		public void flush(boolean force) throws IOException {
+			if ( force || fBuffer.length() > 512) {
+				Display.getDefault().syncExec(new Runnable() {
+					public void run() {
+						if (CPluginPreferencePage.isConsoleOnTop())
+							bringConsoleOnTop();
+						try {
+							int len = fDocument.getLength();
+							fDocument.replace(len, 0, readBuffer());
+						}
+						catch (BadLocationException x) {
+						}
 					}
-				}
-			});
+				});
+			}
 		}

 		void bringConsoleOnTop() {
@@ -111,6 +116,11 @@
 				}
 			}
 		}
+
+		public void close() throws IOException {
+			flush(true);
+		}
+
 	}
 	
 	public BuildConsoleManager() {



Back to the top