提交 c68bd520 authored 作者: Thomas Mueller's avatar Thomas Mueller

Some minor speedup

上级 525b688c
...@@ -31,6 +31,7 @@ public class TestPerfectHash extends TestBase { ...@@ -31,6 +31,7 @@ public class TestPerfectHash extends TestBase {
*/ */
public static void main(String... a) throws Exception { public static void main(String... a) throws Exception {
TestPerfectHash test = (TestPerfectHash) TestBase.createCaller().init(); TestPerfectHash test = (TestPerfectHash) TestBase.createCaller().init();
test.measure();
largeFile(); largeFile();
test.test(); test.test();
test.measure(); test.measure();
...@@ -39,11 +40,11 @@ public class TestPerfectHash extends TestBase { ...@@ -39,11 +40,11 @@ public class TestPerfectHash extends TestBase {
private static void largeFile() throws IOException { private static void largeFile() throws IOException {
largeFile("sequence.txt"); largeFile("sequence.txt");
for (int i = 1; i <= 4; i++) { for (int i = 1; i <= 4; i++) {
largeFile("uniq" + i + ".txt"); largeFile("unique" + i + ".txt");
} }
largeFile("enwiki-20140811-all-titles.txt"); largeFile("enwiki-20140811-all-titles.txt");
} }
private static void largeFile(String s) throws IOException { private static void largeFile(String s) throws IOException {
String fileName = System.getProperty("user.home") + "/temp/" + s; String fileName = System.getProperty("user.home") + "/temp/" + s;
RandomAccessFile f = new RandomAccessFile(fileName, "r"); RandomAccessFile f = new RandomAccessFile(fileName, "r");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论