Index: contrib/icu/src/benchmark/conf/benchmark.collation.alg
===================================================================
--- contrib/icu/src/benchmark/conf/benchmark.collation.alg	(revision 0)
+++ contrib/icu/src/benchmark/conf/benchmark.collation.alg	(revision 0)
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+content.source=org.apache.lucene.benchmark.byTask.feeds.LineDocSource
+content.source.encoding=UTF-8
+docs.file=src/benchmark/work/top.fr.wikipedia.words.txt
+content.source.forever=false
+log.step=100000
+
+{ "Rounds"
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.KeywordLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.fr.wikipedia.words.txt)
+    ResetInputs
+    { "FrenchKeyword" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.KeywordLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.de.wikipedia.words.txt)
+    ResetInputs
+    { "GermanKeyword" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.KeywordLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.uk.wikipedia.words.txt)
+    ResetInputs
+    { "UkrainianKeyword" { ReadTokens > : * ResetInputs } : 10
+ 
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.KeywordLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.en.wikipedia.words.txt)
+    ResetInputs
+    { "EnglishKeyword" { ReadTokens > : * ResetInputs } : 10
+ 
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.FrenchCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.fr.wikipedia.words.txt)
+    ResetInputs
+    { "FrenchJDK" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.GermanCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.de.wikipedia.words.txt)
+    ResetInputs
+    { "GermanJDK" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.UkrainianCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.uk.wikipedia.words.txt)
+    ResetInputs
+    { "UkrainianJDK" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.EnglishCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.en.wikipedia.words.txt)
+    ResetInputs
+    { "EnglishJDK" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.FrenchICUCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.fr.wikipedia.words.txt)
+    ResetInputs
+    { "FrenchICU" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.GermanICUCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.de.wikipedia.words.txt)
+    ResetInputs
+    { "GermanICU" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.UkrainianICUCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.uk.wikipedia.words.txt)
+    ResetInputs
+    { "UkrainianICU" { ReadTokens > : * ResetInputs } : 10
+
+    -NewAnalyzer(org.apache.lucene.collation.benchmark.EnglishICUCollationKeyLineDocAnalyzer)
+    -SetProp(docs.file,src/benchmark/work/top.en.wikipedia.words.txt)
+    ResetInputs
+    { "EnglishICU" { ReadTokens > : * ResetInputs } : 10
+
+    NewRound
+
+} : 5
+
+RepSumByNameRound
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.text.Collator;
+import java.util.Locale;
+
+public final class UkrainianCollationKeyLineDocAnalyzer
+  extends BaseCollationKeyLineDocAnalyzer {
+  public UkrainianCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("uk")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianICUCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianICUCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/UkrainianICUCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.ibm.icu.text.Collator;
+
+import java.util.Locale;
+
+public final class UkrainianICUCollationKeyLineDocAnalyzer
+  extends BaseICUCollationKeyLineDocAnalyzer {
+  public UkrainianICUCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("uk")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.text.Collator;
+import java.util.Locale;
+
+public final class FrenchCollationKeyLineDocAnalyzer
+  extends BaseCollationKeyLineDocAnalyzer {
+  public FrenchCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("fr")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchICUCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchICUCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/FrenchICUCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.ibm.icu.text.Collator;
+
+import java.util.Locale;
+
+public final class FrenchICUCollationKeyLineDocAnalyzer
+  extends BaseICUCollationKeyLineDocAnalyzer {
+  public FrenchICUCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("fr")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/KeywordLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/KeywordLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/KeywordLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,47 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.PerFieldAnalyzerWrapper;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
+
+import java.io.IOException;
+import java.io.Reader;
+
+public final class KeywordLineDocAnalyzer extends Analyzer {
+  private PerFieldAnalyzerWrapper wrapper
+    = new PerFieldAnalyzerWrapper(new KeywordAnalyzer());
+
+  public KeywordLineDocAnalyzer() {
+    wrapper.addAnalyzer(DocMaker.BODY_FIELD, new KeywordAnalyzer());
+  }
+
+  @Override
+  public TokenStream tokenStream(String fieldName, Reader reader) {
+    return wrapper.tokenStream(fieldName, reader);
+  }
+
+  @Override
+  public TokenStream reusableTokenStream
+    (String fieldName, final Reader reader) throws IOException {
+      return wrapper.reusableTokenStream(fieldName, reader);
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.text.Collator;
+import java.util.Locale;
+
+public final class EnglishCollationKeyLineDocAnalyzer
+  extends BaseCollationKeyLineDocAnalyzer {
+  public EnglishCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("en")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,28 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.text.Collator;
+import java.util.Locale;
+
+public final class GermanCollationKeyLineDocAnalyzer
+  extends BaseCollationKeyLineDocAnalyzer {
+  public GermanCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("de")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,51 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.PerFieldAnalyzerWrapper;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
+import org.apache.lucene.collation.CollationKeyAnalyzer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.text.Collator;
+
+public class BaseCollationKeyLineDocAnalyzer extends Analyzer {
+  private PerFieldAnalyzerWrapper wrapper
+    = new PerFieldAnalyzerWrapper(new KeywordAnalyzer());
+
+  public BaseCollationKeyLineDocAnalyzer(Collator collator) {
+    Analyzer analyzer = new CollationKeyAnalyzer(collator);
+    // Keyword analysis for non-body fields
+    wrapper.addAnalyzer(DocMaker.BODY_FIELD, analyzer);
+  }
+
+  @Override
+  public TokenStream tokenStream(String fieldName, Reader reader) {
+    return wrapper.tokenStream(fieldName, reader);
+  }
+
+  @Override
+  public TokenStream reusableTokenStream
+    (String fieldName, final Reader reader) throws IOException {
+      return wrapper.reusableTokenStream(fieldName, reader);
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishICUCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishICUCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/EnglishICUCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.ibm.icu.text.Collator;
+
+import java.util.Locale;
+
+public final class EnglishICUCollationKeyLineDocAnalyzer
+  extends BaseICUCollationKeyLineDocAnalyzer {
+  public EnglishICUCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("en")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanICUCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanICUCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/GermanICUCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,29 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.ibm.icu.text.Collator;
+
+import java.util.Locale;
+
+public final class GermanICUCollationKeyLineDocAnalyzer
+  extends BaseICUCollationKeyLineDocAnalyzer {
+  public GermanICUCollationKeyLineDocAnalyzer() {
+    super(Collator.getInstance(new Locale("de")));
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseICUCollationKeyLineDocAnalyzer.java
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseICUCollationKeyLineDocAnalyzer.java	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/BaseICUCollationKeyLineDocAnalyzer.java	(revision 0)
@@ -0,0 +1,51 @@
+package org.apache.lucene.collation.benchmark;
+
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.ibm.icu.text.Collator;
+import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.KeywordAnalyzer;
+import org.apache.lucene.analysis.PerFieldAnalyzerWrapper;
+import org.apache.lucene.analysis.TokenStream;
+import org.apache.lucene.benchmark.byTask.feeds.DocMaker;
+import org.apache.lucene.collation.ICUCollationKeyAnalyzer;
+
+import java.io.IOException;
+import java.io.Reader;
+
+public class BaseICUCollationKeyLineDocAnalyzer extends Analyzer {
+  private PerFieldAnalyzerWrapper wrapper
+    = new PerFieldAnalyzerWrapper(new KeywordAnalyzer());
+
+  public BaseICUCollationKeyLineDocAnalyzer(Collator collator) {
+    Analyzer analyzer = new ICUCollationKeyAnalyzer(collator);
+    // Keyword analysis for non-body fields
+    wrapper.addAnalyzer(DocMaker.BODY_FIELD, analyzer);
+  }
+
+  @Override
+  public TokenStream tokenStream(String fieldName, Reader reader) {
+    return wrapper.tokenStream(fieldName, reader);
+  }
+
+  @Override
+  public TokenStream reusableTokenStream
+    (String fieldName, final Reader reader) throws IOException {
+      return wrapper.reusableTokenStream(fieldName, reader);
+  }
+}
Index: contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/package.html
===================================================================
--- contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/package.html	(revision 0)
+++ contrib/icu/src/benchmark/src/org/apache/lucene/collation/benchmark/package.html	(revision 0)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html>
+<head>
+    <title>(ICU)CollationKeyFilter benchmarking package</title>
+</head>
+<body>
+<p>
+    This package contains code to provide zero-argument collation key analyzers
+    for various languages over contrib benchmark LineDoc formatted input files.
+</p>
+<p>
+    The <code>KeywordLineDocAnalyzer</code> class is used to isolate the
+    collation key filter elapsed time contribution from that of other elements
+    of the analysis pipeline.
+</p>
+</body>
+</html>
Index: contrib/icu/src/benchmark/bin/bm2jira.pl
===================================================================
--- contrib/icu/src/benchmark/bin/bm2jira.pl	(revision 0)
+++ contrib/icu/src/benchmark/bin/bm2jira.pl	(revision 0)
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ----------
+# bm2jira.pl
+#
+# Converts Lucene contrib-benchmark output produced using the 
+# benchmark.collation.alg file into a JIRA-formatted table.
+#
+
+use strict;
+use warnings;
+
+my %min_elapsed = ();
+
+while (<>) {
+  if (/(\S+)(Keyword|JDK|ICU)_\d+\s*([^\s{].*)/) {
+    my $lang = $1;
+    my $analyzer = $2;
+    my $stats = $3;
+    my ($elapsed) = $stats =~ /(?:[\d,.]+[-\s]*){4}([.\d]+)/;
+    $min_elapsed{$analyzer}{$lang} = $elapsed
+      unless (defined($min_elapsed{$analyzer}{$lang})
+              && $elapsed >= $min_elapsed{$analyzer}{$lang});
+  }
+}
+
+# Print out platform info
+print "JAVA:\n", `java -version 2>&1`, "\nOS:\n";
+if ($^O =~ /win/i) {
+  print "$^O\n";
+  eval {
+    require Win32;
+    print Win32::GetOSName(), "\n", Win32::GetOSVersion(), "\n";
+  };
+  die "Error loading Win32: $@" if ($@);
+} else {
+  print `uname -a 2>&1`;
+}
+
+print "\n||Language||java.text||ICU4J||KeywordAnalyzer||ICU4J Improvement||\n";
+
+for my $lang (sort keys %{$min_elapsed{ICU}}) {
+  my $ICU = $min_elapsed{ICU}{$lang};
+  my $JDK = $min_elapsed{JDK}{$lang};
+  my $keyword = $min_elapsed{Keyword}{$lang};
+  my $improved = int(100 * ($JDK - $ICU) / ($ICU - $keyword) + 0.5);
+  printf "|$lang|${JDK}s|${ICU}s|${keyword}s|\%d%%|\n", $improved;
+}
Index: contrib/icu/src/benchmark/bin/compare.collation.benchmark.tables.pl
===================================================================
--- contrib/icu/src/benchmark/bin/compare.collation.benchmark.tables.pl	(revision 0)
+++ contrib/icu/src/benchmark/bin/compare.collation.benchmark.tables.pl	(revision 0)
@@ -0,0 +1,91 @@
+#!/usr/bin/perl
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ------------------------------------------
+# compare.collation.benchmark.jira.tables.pl
+#
+# Takes as cmdline parameters two JIRA-formatted benchmark results, as produced
+# by bm2jira.pl (located in the same directory as this script), and outputs a
+# third JIRA-formatted comparison table, showing the differences between two
+# benchmarking runs' java.text and ICU4J columns, after accounting for the
+# KeywordAnalyzer column; the "ICU4J Improvement" column is ignored.
+#
+# The difference is calculated as a percentage:
+#
+#   100 * (patched-rate - unpatched-rate / unpatched-rate)
+#
+# where the (un)patched-rate is:
+#
+#   1 / ( elapsed-(un)patched-time - elapsed-KeywordAnalyzer-time)
+#
+
+use strict;
+use warnings;
+
+my $usage = "Usage: $0 <unpatched-file> <patched-file>\n";
+
+die $usage unless ($#ARGV == 1 && -f $ARGV[0] && -f $ARGV[1]);
+
+my %stats = ();
+
+open UNPATCHED, "<$ARGV[0]" || die "ERROR opening '$ARGV[0]': $!";
+while (<UNPATCHED>) {
+  # ||Language||java.text||ICU4J||KeywordAnalyzer||ICU4J Improvement||
+  # |English|4.51s|2.47s|1.47s|204%|
+  next unless (/^\|([^|]+)\|([^|s]+)s\|([^|s]+)s\|([^|s]+)s/);
+  my ($lang, $jdk_elapsed, $icu_elapsed, $keyword_analyzer_elapsed)
+    = ($1, $2, $3, $4);
+  $stats{unpatched}{$lang}{jdk} = $jdk_elapsed;
+  $stats{unpatched}{$lang}{icu} = $icu_elapsed;
+  $stats{unpatched}{$lang}{keyword_analyzer} = $keyword_analyzer_elapsed;
+}
+close UNPATCHED;
+
+open PATCHED, "<$ARGV[1]" || die "ERROR opening '$ARGV[1]': $!";
+while (<PATCHED>) {
+  # ||Language||java.text||ICU4J||KeywordAnalyzer||ICU4J Improvement||
+  # |English|4.51s|2.47s|1.47s|204%|
+  next unless (/^\|([^|]+)\|([^|s]+)s\|([^|s]+)s\|([^|s]+)s/);
+  my ($lang, $jdk_elapsed, $icu_elapsed, $keyword_analyzer_elapsed)
+    = ($1, $2, $3, $4);
+  $stats{patched}{$lang}{jdk} = $jdk_elapsed;
+  $stats{patched}{$lang}{icu} = $icu_elapsed;
+  $stats{patched}{$lang}{keyword_analyzer} = $keyword_analyzer_elapsed;
+}
+close PATCHED;
+
+print "||Language||java.text improvement||ICU4J improvement||\n";
+for my $lang (sort keys %{$stats{unpatched}}) {
+  my $keyword_analyzer1 = $stats{unpatched}{$lang}{keyword_analyzer};
+  my $jdk1 = $stats{unpatched}{$lang}{jdk};
+  my $jdk_diff1 = $jdk1 - $keyword_analyzer1;
+  my $icu1 = $stats{unpatched}{$lang}{icu};
+  my $icu_diff1 = $icu1 - $keyword_analyzer1;
+
+  my $keyword_analyzer2 = $stats{patched}{$lang}{keyword_analyzer};
+  my $jdk2 = $stats{patched}{$lang}{jdk};
+  my $jdk_diff2 = $jdk2 - $keyword_analyzer2;
+  my $icu2 = $stats{patched}{$lang}{icu};
+  my $icu_diff2 = $icu2 - $keyword_analyzer2;
+
+  my $jdk_impr 
+    = int((1./$jdk_diff2 - 1./$jdk_diff1) / (1./$jdk_diff1) * 1000 + 5) / 10;
+  my $icu_impr
+    = int((1./$icu_diff2 - 1./$icu_diff1) / (1./$icu_diff1) * 1000 + 5) / 10;
+
+  printf "|$lang|%2.1f%%|%2.1f%%|\n", $jdk_impr, $icu_impr;
+}
Index: contrib/icu/build.xml
===================================================================
--- contrib/icu/build.xml	(revision 897474)
+++ contrib/icu/build.xml	(working copy)
@@ -35,5 +35,127 @@
   />
 
   <import file="../contrib-build.xml"/>
+    
+  <target name="clean">
+    <antcall target="common.clean"/>
+    <ant target="common.clean">
+      <property name="build.dir" value="${icu.benchmark.build.dir}"/>
+    </ant>
+  </target>
 
+  <property name="lucene.core.jar" location="../../build/lucene-core-${version}.jar"/>
+  <available property="lucene.core.jar.present" type="file" file="${lucene.core.jar}"/>
+  <target name="jar-lucene-core" unless="lucene.core.jar.present">
+    <echo>Building dependency: lucene-core</echo>
+    <ant target="jar-core" inheritall="false" dir="../.."/>
+  </target>
+
+  <property name="lucene.contrib.benchmark.jar"
+            location="../../build/contrib/benchmark/lucene-benchmark-${version}.jar"/>
+  <available property="lucene.contrib.benchmark.jar.present" 
+             type="file" 
+             file="${lucene.contrib.benchmark.jar}"/>
+  <target name="jar-lucene-contrib-benchmark" 
+          unless="lucene.contrib.benchmark.jar.present">
+    <echo>Building dependency: version: ${version}  - ${lucene.contrib.benchmark.jar}</echo>
+    <ant target="jar" inheritall="false" dir="../benchmark"/>
+  </target>
+
+  <property name="lucene.contrib.icu.jar"
+            location="../../build/contrib/icu/lucene-icu-${version}.jar"/>
+  <available property="lucene.contrib.icu.jar.present" 
+             type="file" 
+             file="${lucene.contrib.icu.jar}"/>
+  <target name="jar-lucene-contrib-icu" 
+          unless="lucene.contrib.icu.jar.present">
+    <echo>Building dependency: ${lucene.contrib.icu.jar}</echo>
+    <antcall target="jar"/>
+  </target>
+
+  <path id="lucene.icu.benchmark.compile.classpath">
+    <file file="${lucene.contrib.benchmark.jar}"/>
+    <file file="${lucene.contrib.icu.jar}"/>
+    <file file="${lucene.core.jar}"/>
+    <fileset dir="lib" includes="icu4j*.jar"/>
+  </path>
+
+  <property name="lucene.icu.benchmark.source.dir" value="src/benchmark/src"/>
+  <property name="lucene.icu.benchmark.build.dir" 
+            value="../../build/contrib/icu-benchmark/classes/java"/>
+
+  <target name="compile-benchmark"
+          depends="jar-lucene-contrib-icu,jar-lucene-core,jar-lucene-contrib-benchmark"
+          description="Compiles code required for the benchmark task">
+    <compile srcdir="${lucene.icu.benchmark.source.dir}"
+             destdir="${lucene.icu.benchmark.build.dir}">
+      <classpath refid="lucene.icu.benchmark.compile.classpath"/>
+    </compile>
+  </target>
+
+  <path id="lucene.icu.benchmark.runtime.classpath">
+    <path refid="lucene.icu.benchmark.compile.classpath"/>
+    <fileset dir="../benchmark/lib" includes="**/*.jar"/>
+    <dirset dir="${lucene.icu.benchmark.build.dir}"/>
+  </path>
+    
+  <property name="task.mem" value="140M"/>
+  <property name="collation.benchmark.alg.file" 
+            location="src/benchmark/conf/benchmark.collation.alg"/>
+  <property name="icu.benchmark.build.dir" 
+            value="../../build/contrib/icu-benchmark"/>
+  <property name="benchmark.output.file" 
+            value="${icu.benchmark.build.dir}/benchmark.output.txt"/>
+  <property name="jira.output.file" 
+            value="${icu.benchmark.build.dir}/bm2jira.output.txt"/>
+
+  <target name="benchmark" depends="compile-benchmark,top-100k-wiki-word-files">
+    <echo>Running contrib/benchmark with alg file: ${collation.benchmark.alg.file}</echo>
+    <java fork="true" classname="org.apache.lucene.benchmark.byTask.Benchmark" 
+          maxmemory="${task.mem}" output="${benchmark.output.file}">
+      <classpath refid="lucene.icu.benchmark.runtime.classpath"/>
+      <arg file="${collation.benchmark.alg.file}"/>
+    </java>
+    <echo>Benchmark output is in file: ${benchmark.output.file}</echo>
+    <echo>Converting to JIRA table format...</echo>
+    <exec executable="perl" output="${jira.output.file}" failonerror="true">
+      <arg value="src/benchmark/bin/bm2jira.pl"/>
+      <arg value="${benchmark.output.file}"/>
+    </exec>
+    <echo>Benchmark output in JIRA table format is in file: ${jira.output.file}</echo>
+  </target>
+
+  <property name="working.dir" location="src/benchmark/work"/>
+  <property name="top.100k.words.archive.filename" 
+            value="top.100k.words.de.en.fr.uk.wikipedia.2009-11.tar.bz2"/>
+  <property name="top.100k.words.archive.base.url"
+            value="http://people.apache.org/~rmuir/wikipedia"/>
+
+  <target name="check-files">
+    <available file="${working.dir}/${top.100k.words.archive.filename}"
+               property="top.100k.words.archive.present"/>
+    <condition property="top.100k.word.files.expanded">
+       <and>
+         <available file="${working.dir}/top.de.wikipedia.words.txt"/>
+         <available file="${working.dir}/top.en.wikipedia.words.txt"/>
+         <available file="${working.dir}/top.fr.wikipedia.words.txt"/>
+         <available file="${working.dir}/top.uk.wikipedia.words.txt"/>
+       </and>
+    </condition>
+  </target>
+
+  <target name="top-100k-wiki-word-files" depends="check-files">
+    <mkdir dir="${working.dir}"/>
+    <antcall target="get-top-100k-words-archive"/>
+    <antcall target="expand-top-100k-word-files"/>
+  </target>
+
+  <target name="expand-top-100k-word-files" unless="top.100k.word.files.expanded">
+    <untar src="${working.dir}/${top.100k.words.archive.filename}"
+           overwrite="true" compression="bzip2" dest="${working.dir}"/>
+  </target>
+
+  <target name="get-top-100k-words-archive" unless="top.100k.words.archive.present">
+    <get src="${top.100k.words.archive.base.url}/${top.100k.words.archive.filename}"
+         dest="${working.dir}/${top.100k.words.archive.filename}"/>
+  </target>
 </project>
