[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-ant-dev] FastPartitioner
|
Anything with "fast" in the name must be good :-)
I have created bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=84082
Thanks
Darins
----- Original Message -----
From: "Tom Eicher" <eclipse@xxxxxxxxxxxxxxx>
To: <platform-ant-dev@xxxxxxxxxxx>
Sent: Monday, January 31, 2005 12:48 AM
Subject: [platform-ant-dev] FastPartitioner
Dear eclipse-ant team!
we have implemented an optimized version of DefaultPartitioner that
caches the positions tracking the partitions, avoiding an array creation
every time the document is asked for the positions. For clients that
only instantiate DefaultPartitioner or subclass it in a way that does
not modify the positions, the new FastPartitioner can be used as
replacement for DefaultPartitioner without further modification.
I have included a patch that does that replacement in the ant.ui plug-in
project.
Happy partitioning,
tom
--------------------------------------------------------------------------------
Index: Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntDocumentSetupParticipant.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ant.ui/Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntDocumentSetupParticipant.java,v
retrieving revision 1.7
diff -u -r1.7 AntDocumentSetupParticipant.java
--- Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntDocumentSetupParticipant.java
26 Aug 2004 00:15:06 -0000 1.7
+++ Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntDocumentSetupParticipant.java
31 Jan 2005 08:38:56 -0000
@@ -14,7 +14,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
/**
* The document setup participant for Ant.
@@ -43,7 +43,7 @@
}
private IDocumentPartitioner createDocumentPartitioner() {
- return new DefaultPartitioner(
+ return new FastPartitioner(
new AntEditorPartitionScanner(), new String[]{
AntEditorPartitionScanner.XML_TAG,
AntEditorPartitionScanner.XML_COMMENT,
Index: Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntStorageDocumentProvider.java
===================================================================
RCS file: /home/eclipse/org.eclipse.ant.ui/Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntStorageDocumentProvider.java,v
retrieving revision 1.3
diff -u -r1.3 AntStorageDocumentProvider.java
--- Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntStorageDocumentProvider.java
26 Aug 2004 00:15:33 -0000 1.3
+++ Ant
Editor/org/eclipse/ant/internal/ui/editor/text/AntStorageDocumentProvider.java
31 Jan 2005 08:38:56 -0000
@@ -13,7 +13,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentExtension3;
import org.eclipse.jface.text.IDocumentPartitioner;
-import org.eclipse.jface.text.rules.DefaultPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
import org.eclipse.ui.editors.text.StorageDocumentProvider;
/**
@@ -39,7 +39,7 @@
}
private IDocumentPartitioner createDocumentPartitioner() {
- return new DefaultPartitioner(
+ return new FastPartitioner(
new AntEditorPartitionScanner(), new String[]{
AntEditorPartitionScanner.XML_TAG,
AntEditorPartitionScanner.XML_COMMENT,