未验证 提交 7836466a 编写于 作者: M Marius 提交者: GitHub

fix(ci) run mvn from root directory (#1317)

上级 2a490bd8
......@@ -41,16 +41,15 @@ public class OooCppBenchmarkSetMemoryShuffle {
}
private static void testSetMemoryShuffleToCsv() {
var r = new OooCppBenchmarkSetMemoryVanilla();
long index = Unsafe.getUnsafe().allocateMemory(BUFFER_MAX_SIZE * 2);
long src = Unsafe.getUnsafe().allocateMemory(BUFFER_MAX_SIZE);
long dest = Unsafe.getUnsafe().allocateMemory(BUFFER_MAX_SIZE);
System.out.println(String.format("src=%d, dest=%d, index=%d\n", src, dest, index));
System.out.printf("src=%d, dest=%d, index=%d\n%n", src, dest, index);
Rnd random = new Rnd();
long size = BUFFER_MAX_SIZE / Long.BYTES;
for (int i = 0; i < size; i++) {
Unsafe.getUnsafe().putLong(index + (i + 1) * Long.BYTES, Math.abs(random.nextLong()) % size);
Unsafe.getUnsafe().putLong(index + (i + 1L) * Long.BYTES, Math.abs(random.nextLong()) % size);
}
try {
......@@ -59,9 +58,9 @@ public class OooCppBenchmarkSetMemoryShuffle {
int iterations = 100;
for (int i = 1; i < 50; i += 1) {
var timeout1 = runReshufle64(iterations, i, index, src, dest);
var timeout2 = runReshufle32(iterations, i, index, src, dest);
var timeout3 = runReshufle16(iterations, i, index, src, dest);
double timeout1 = runReshufle64(iterations, i, index, src, dest);
double timeout2 = runReshufle32(iterations, i, index, src, dest);
double timeout3 = runReshufle16(iterations, i, index, src, dest);
System.out.println("" + i + ", " + timeout1 + ", " + timeout2 + ", " + timeout3);
}
} finally {
......@@ -72,35 +71,35 @@ public class OooCppBenchmarkSetMemoryShuffle {
}
private static double runReshufle64(int iterations, int mb, long index, long src, long dest) {
var nt = System.nanoTime();
long nt = System.nanoTime();
long size = MB * mb / 8;
for (int j = 0; j < iterations; j++) {
Vect.indexReshuffle64Bit(src, dest, index, size);
}
var timeout = System.nanoTime() - nt;
long timeout = System.nanoTime() - nt;
return Math.round(timeout * 1E-1 / iterations) / 100.0;
}
private static double runReshufle32(int iterations, int mb, long index, long src, long dest) {
var nt = System.nanoTime();
long nt = System.nanoTime();
long size = MB * mb / 4;
for (int j = 0; j < iterations; j++) {
Vect.indexReshuffle32Bit(src, dest, index, size);
}
var timeout = System.nanoTime() - nt;
long timeout = System.nanoTime() - nt;
return Math.round(timeout * 1E-1 / iterations) / 100.0;
}
private static double runReshufle16(int iterations, int mb, long index, long src, long dest) {
var nt = System.nanoTime();
long nt = System.nanoTime();
long size = MB * mb / 2;
for (int j = 0; j < iterations; j++) {
Vect.indexReshuffle16Bit(src, dest, index, size);
}
var timeout = System.nanoTime() - nt;
long timeout = System.nanoTime() - nt;
return Math.round(timeout * 1E-1 / iterations) / 100.0;
}
}
......@@ -40,7 +40,7 @@ public class OooCppBenchmarkSetMemoryVanilla {
}
private static void testSetMemoryVanillaToCsv() {
var r = new OooCppBenchmarkSetMemoryVanilla();
OooCppBenchmarkSetMemoryVanilla r = new OooCppBenchmarkSetMemoryVanilla();
r.mallocBuffer();
// warmup
......@@ -52,16 +52,16 @@ public class OooCppBenchmarkSetMemoryVanilla {
int iterations = 500;
for (int i = 1; i < 50; i += 1) {
var timeout1 = runDoubleKs(iterations, i);
var timeout2 = runLongsKs(iterations, i, Long.MIN_VALUE);
var timeout3 = runLongsKs(iterations, i, -1L);
double timeout1 = runDoubleKs(iterations, i);
double timeout2 = runLongsKs(iterations, i, Long.MIN_VALUE);
double timeout3 = runLongsKs(iterations, i, -1L);
System.out.println("" + i + ", " + timeout1 + ", " + timeout2 + ", " + timeout3);
}
r.freeBuffer();
}
private static double runDoubleKs(int iterations, int i) {
var nt = System.nanoTime();
long nt = System.nanoTime();
for (int j = 0; j < iterations; j++) {
Vect.setMemoryDouble(
buffer,
......@@ -69,12 +69,12 @@ public class OooCppBenchmarkSetMemoryVanilla {
i * MB / Double.BYTES
);
}
var timeout = System.nanoTime() - nt;
long timeout = System.nanoTime() - nt;
return Math.round(timeout * 1E-1 / iterations) / 100.0;
}
private static double runLongsKs(int iterations, int i, long value) {
var nt = System.nanoTime();
long nt = System.nanoTime();
for (int j = 0; j < iterations; j++) {
Vect.setMemoryLong(
buffer,
......@@ -82,7 +82,7 @@ public class OooCppBenchmarkSetMemoryVanilla {
i * MB / Long.BYTES
);
}
var timeout = System.nanoTime() - nt;
long timeout = System.nanoTime() - nt;
return Math.round(timeout * 1E-1 / iterations) / 100.0;
}
......
......@@ -11,7 +11,7 @@ jobs:
# No PR - cannot detect changed files, default to true
echo "##vso[task.setvariable variable=SOURCE_CODE_CHANGED;isOutput=true]true"
else
CHANGED_CORE_FILES=$(curl https://api.github.com/repos/questdb/questdb/pulls/$PR_ID/files -s | grep -oP 'filename": "core/*\/\K[^.]+')
CHANGED_CORE_FILES=$(curl https://api.github.com/repos/questdb/questdb/pulls/$PR_ID/files -s | grep -oP 'filename": "(core|benchmarks)/*\/\K[^.]+')
if [ -z "$CHANGED_CORE_FILES" ]
then
echo "##vso[task.setvariable variable=SOURCE_CODE_CHANGED;isOutput=true]false"
......
......@@ -21,7 +21,7 @@ steps:
- task: Maven@3
displayName: "Compile with Maven"
inputs:
mavenPomFile: "core/pom.xml"
mavenPomFile: "pom.xml"
mavenOptions: "$(MAVEN_OPTS)"
options: "compile -DskipTests -P build-web-console,use-built-in-nodejs -Dhttp.keepAlive=false"
jdkVersionOption: $(jdk)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册