Skip to content

Commit

Permalink
Added performance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Oct 14, 2024
1 parent 60915e5 commit 9dd5a31
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
25 changes: 25 additions & 0 deletions exaudfclient/base/javacontainer/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ java_test(
JAVACONTAINER_TEST_SRCS = ["cpp/javacontainer_test.cc", "cpp/exaudf_wrapper.cc", "cpp/javavm_test.cc", "cpp/javavm_test.h",
"cpp/swig_factory_test.h", "cpp/swig_factory_test.cc"]

JAVACONTAINER_PERF_TEST_SRCS = ["cpp/javacontainer_perf_test.cc", "cpp/exaudf_wrapper.cc", "cpp/javavm_test.cc", "cpp/javavm_test.h",
"cpp/swig_factory_test.h", "cpp/swig_factory_test.cc"]

cc_test(
name = "javacontainer-test-legacy-parser",
srcs = JAVACONTAINER_TEST_SRCS,
Expand All @@ -33,3 +36,25 @@ cc_test(
defines = ["USE_CTPG_PARSER"],
data = ["test.jar", "other_test.jar"]
)


cc_test(
name = "javacontainer-perf-test-legacy-parser",
srcs = JAVACONTAINER_PERF_TEST_SRCS,
deps = [
"//base/javacontainer:javacontainer",
"@googletest//:gtest_main",
],
data = ["test.jar", "other_test.jar"]
)

cc_test(
name = "javacontainer-perf-test-ctpg-parser",
srcs = JAVACONTAINER_PERF_TEST_SRCS,
deps = [
"//base/javacontainer:javacontainer",
"@googletest//:gtest_main",
],
defines = ["USE_CTPG_PARSER"],
data = ["test.jar", "other_test.jar"]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include "include/gtest/gtest.h"
#include "gmock/gmock.h"
#include "base/javacontainer/test/cpp/javavm_test.h"
#include "base/javacontainer/test/cpp/swig_factory_test.h"
#include <string.h>

const uint32_t NumInlineJavaLines = 500000;
const uint32_t NumInlineJavaWordsPerLine = 100;


TEST(JavaContainerPerformance, large_inline_java_udf_test) {
std::string script_code =
"%jvmoption option1=abc;\n"
"%jvmoption option2=def;\n"
"class JVMOPTION_TEST_WITH_SPACE {\n"
"static void run(ExaMetadata exa, ExaIterator ctx) throws Exception {\n\n";

for (uint32_t idxLine(0); idxLine < NumInlineJavaLines; idxLine++) {
for (uint32_t idxWord(0); idxWord < NumInlineJavaWordsPerLine; idxWord++)
script_code.append("somecode ");
script_code.append("\n");
}
script_code.append(" }\n}\n");
JavaVMTest vm(script_code);
}


0 comments on commit 9dd5a31

Please sign in to comment.