LUCENE-1027: Added better formatting of doubles, added wikipedia-flush-by-RAM for comparison

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@583792 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2007-10-11 12:10:31 +00:00
parent 9c9ebe5cf4
commit b7253a06b7
5 changed files with 82 additions and 3 deletions

View File

@ -19,7 +19,7 @@
#merge.factor=mrg:10:100:10:100
#max.buffered=buf:10:10:100:100
ram.flush.mb=ram:32:40:48:56
ram.flush.mb=flush:32:40:48:56
compound=true
analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer

View File

@ -19,7 +19,7 @@
#merge.factor=mrg:10:100:10:100:10:100:10:100
#max.buffered=buf:10:10:100:100:10:10:100:100
ram.flush.mb=ram:32:40:48:56:32:40:48:56
ram.flush.mb=flush:32:40:48:56:32:40:48:56
compound=cmpnd:true:true:true:true:false:false:false:false
analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer

View File

@ -0,0 +1,69 @@
#/**
# * 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.
# */
# -------------------------------------------------------------------------------------
# multi val params are iterated by NewRound's, added to reports, start with column name.
#
# based on micro-standard
#
# modified to use wikipedia sources and index entire docs
# currently just used to measure ingest rate
#merge.factor=mrg:10:100:10:100
#max.buffered=buf:10:10:100:100
ram.flush.mb=ram:32:40:48:56
max.field.length=2147483647
compound=true
analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer
directory=FSDirectory
doc.stored=true
doc.tokenized=true
doc.term.vector=false
doc.add.log.step=500
docs.dir=enwiki
doc.maker=org.apache.lucene.benchmark.byTask.feeds.DirDocMaker
query.maker=org.apache.lucene.benchmark.byTask.feeds.ReutersQueryMaker
# task at this depth or less would print when they start
task.max.depth.log=2
log.queries=false
# -------------------------------------------------------------------------------------
{ "Rounds"
ResetSystemErase
{ "Populate"
CreateIndex
{ "MAddDocs" AddDoc > : 200000
CloseIndex
}
NewRound
} : 8
RepSumByName
RepSumByPrefRound MAddDocs

View File

@ -376,7 +376,7 @@ public class Config {
else if (a instanceof double[]) {
double ad[] = (double[]) a;
int n = roundNum % ad.length;
sb.append(Format.format(2, (float) ad[n],template));
sb.append(Format.format(2, ad[n],template));
}
else {
boolean ab[] = (boolean[]) a;

View File

@ -52,6 +52,11 @@ public class Format {
return res.substring(res.length() - col.length());
}
public static String format(int numFracDigits, double f, String col) {
String res = padd + numFormat[numFracDigits].format(f);
return res.substring(res.length() - col.length());
}
/**
* Padd a number from right.
* @param numFracDigits number of digits in fraction part - must be 0 or 1 or 2.
@ -64,6 +69,11 @@ public class Format {
return res.substring(0, col.length());
}
public static String formatPaddRight(int numFracDigits, double f, String col) {
String res = numFormat[numFracDigits].format(f) + padd;
return res.substring(0, col.length());
}
/**
* Padd a number from left.
* @param n number to be formatted.