FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

add skeleton for new benchmark · blacelle/JavaFastPFOR@f91e298 · GitHub

Repository navigation

Commit f91e298

Browse files
committed
add skeleton for new benchmark
1 parent c7a4df8 commit f91e298

2 files changed

Lines changed: 54 additions & 1 deletion

File tree

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<artifactId>exec-maven-plugin</artifactId>
8383
<version>1.1</version>
8484
<configuration>
85-
<mainClass>me.lemire.integercompression.Benchmark</mainClass>
85+
<mainClass>me.lemire.integercompression.BenchmarkOffsettedSeries</mainClass>
8686
</configuration>
8787
</plugin>
8888

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* This code is released under the
3+
* Apache License Version 2.0 http://www.apache.org/licenses/.
4+
*/
5+
package me.lemire.integercompression;
6+
7+
import java.util.Random;
8+
9+
public class BenchmarkOffsettedSeries
10+
{
11+
public static final int DEFAULT_MEAN = 1 << 20;
12+
public static final int DEFAULT_RANGE = 1 << 10;
13+
14+
public BenchmarkOffsettedSeries() {
15+
}
16+
17+
/**
18+
* Run benchmark.
19+
*
20+
* @param count Count of data chunks.
21+
* @param length Length of a data chunk.
22+
*/
23+
public void run(int count, int length) {
24+
int[][] data = generateDataChunks(0, count, length,
25+
DEFAULT_MEAN, DEFAULT_RANGE);
26+
// TODO:
27+
}
28+
29+
public static int[][] generateDataChunks(
30+
long seed,
31+
int count,
32+
int length,
33+
int mean,
34+
int range)
35+
{
36+
int offset = mean - range / 2;
37+
int[][] chunks = new int[count][];
38+
Random r = new Random(seed);
39+
for (int i = 0; i < count; ++i) {
40+
int[] chunk = chunks[i] = new int[length];
41+
for (int j = 0; j < length; ++j) {
42+
chunk[j] = (r.nextInt() % range) + offset;
43+
}
44+
}
45+
return chunks;
46+
}
47+
48+
public static void main(String[] args) {
49+
BenchmarkOffsettedSeries b = new BenchmarkOffsettedSeries();
50+
b.run(1024, 1024);
51+
System.out.println("Hello BenchmarkOffsettedSeries");
52+
}
53+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL