diff options
author | va-kuznecov <va-kuznecov@ydb.tech> | 2022-08-24 15:15:42 +0300 |
---|---|---|
committer | va-kuznecov <va-kuznecov@ydb.tech> | 2022-08-24 15:15:42 +0300 |
commit | 81b0f9dfa1c7c7f19d14d7300459b11314e43ffb (patch) | |
tree | 0e4d602406b5a2b2831237628b725f93188bd650 | |
parent | 558cd04f97890a2b80383f4b792beafde1721f73 (diff) | |
download | ydb-81b0f9dfa1c7c7f19d14d7300459b11314e43ffb.tar.gz |
Decrease UT time
Decrease UT time
Fix wide MapJoin
-rw-r--r-- | ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp b/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp index 4528d44c33d..907afe6fe19 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp +++ b/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp @@ -384,7 +384,7 @@ TRuntimeNode CreateSqueezeToSortedDict(TProgramBuilder& pb, size_t vecSize, TCal Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { template<class T> - void ParallelProgTest(T f, bool useLLVM, ui64 testResult, size_t vecSize = 100'000) { + void ParallelProgTest(T f, bool useLLVM, ui64 testResult, size_t vecSize = 10'000) { TTimer t("total: "); const ui32 cacheSize = 10; const ui32 inFlight = 3; @@ -467,27 +467,27 @@ Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { } Y_UNIT_TEST_QUAD(Filter, Wide, UseLLVM) { - ParallelProgTest(CreateFilter<Wide>, UseLLVM, 136480896); + ParallelProgTest(CreateFilter<Wide>, UseLLVM, 10098816); } Y_UNIT_TEST_QUAD(Map, Wide, UseLLVM) { - ParallelProgTest(CreateMap<Wide>, UseLLVM, 782); + ParallelProgTest(CreateMap<Wide>, UseLLVM, 78); } Y_UNIT_TEST_QUAD(Condense, Wide, UseLLVM) { - ParallelProgTest(CreateCondense<Wide>, UseLLVM, 17451450000); + ParallelProgTest(CreateCondense<Wide>, UseLLVM, 1295145000); } Y_UNIT_TEST_QUAD(Chopper, Wide, UseLLVM) { - ParallelProgTest(CreateChopper<Wide>, UseLLVM, 17451450000); + ParallelProgTest(CreateChopper<Wide>, UseLLVM, 1295145000); } Y_UNIT_TEST_QUAD(Combine, Wide, UseLLVM) { - ParallelProgTest(CreateCombine<Wide>, UseLLVM, 17451450000); + ParallelProgTest(CreateCombine<Wide>, UseLLVM, 1295145000); } Y_UNIT_TEST_QUAD(Chain1Map, Wide, UseLLVM) { - ParallelProgTest(CreateChain1Map<Wide>, UseLLVM, 789247892400000); + ParallelProgTest(CreateChain1Map<Wide>, UseLLVM, 6393039240000); } Y_UNIT_TEST_QUAD(Discard, Wide, UseLLVM) { @@ -495,15 +495,15 @@ Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { } Y_UNIT_TEST_QUAD(Skip, Wide, UseLLVM) { - ParallelProgTest(CreateSkip<Wide>, UseLLVM, 17389067750); + ParallelProgTest(CreateSkip<Wide>, UseLLVM, 1232762750); } Y_UNIT_TEST_QUAD(NarrowFlatMap, Flow, UseLLVM) { - ParallelProgTest(CreateNarrowFlatMap<Flow>, UseLLVM, 17451450000); + ParallelProgTest(CreateNarrowFlatMap<Flow>, UseLLVM, 1295145000); } Y_UNIT_TEST_TWIN(NarrowMultiMap, UseLLVM) { - ParallelProgTest(CreateNarrowMultiMap, UseLLVM, 17451450000ull * 2); + ParallelProgTest(CreateNarrowMultiMap, UseLLVM, 1295145000ull * 2); } Y_UNIT_TEST_QUAD(SqueezeToSortedDict, WithPayload, UseLLVM) { @@ -590,10 +590,12 @@ Y_UNIT_TEST_SUITE(ComputationPatternCache) { auto graph = pattern->Clone(opts.ToComputationOptions(*randomProvider, *timeProvider)); t_clone.reset(); + const ui64 repeats = 100'000; + { TTimer t("graph: "); ui64 acc = 0; - for (ui32 i = 0; i < 100'000'000; ++i) { + for (ui64 i = 0; i < repeats; ++i) { acc += graph->GetValue().Get<ui64>(); } Y_DO_NOT_OPTIMIZE_AWAY(acc); @@ -605,7 +607,7 @@ Y_UNIT_TEST_SUITE(ComputationPatternCache) { TTimer t("lambda: "); ui64 acc = 0; - for (ui32 i = 0; i < 100'000'000; ++i) { + for (ui64 i = 0; i < repeats; ++i) { acc += add(123591592ULL, 323591592ULL); } Y_DO_NOT_OPTIMIZE_AWAY(acc); @@ -621,7 +623,7 @@ Y_UNIT_TEST_SUITE(ComputationPatternCache) { TUnboxedValue acc(TUnboxedValuePod(0)); TUnboxedValue v1(TUnboxedValuePod(ui64{123591592UL})); TUnboxedValue v2(TUnboxedValuePod(ui64{323591592UL})); - for (ui32 i = 0; i < 100'000'000; ++i) { + for (ui64 i = 0; i < repeats; ++i) { auto r = add(v1, v2); acc = add(r, acc); } @@ -636,7 +638,7 @@ Y_UNIT_TEST_SUITE(ComputationPatternCache) { auto functionRegistry = CreateFunctionRegistry(CreateBuiltinRegistry())->Clone(); TProgramBuilder pb(typeEnv, *functionRegistry); - const ui64 vecSize = 100'000'000; + const ui64 vecSize = 100'000; Cerr << "vecSize: " << vecSize << Endl; const auto listType = pb.NewListType(pb.NewDataType(NUdf::TDataType<ui64>::Id)); const auto list = TCallableBuilder(pb.GetTypeEnvironment(), "TestList", listType).Build(); @@ -677,6 +679,9 @@ Y_UNIT_TEST_SUITE(ComputationPatternCache) { UNIT_ASSERT_VALUES_EQUAL(count, 781263); } else if (vecSize == 10'000'000) { UNIT_ASSERT_VALUES_EQUAL(acc, 222145217664); + } else if (vecSize == 100'000) { + UNIT_ASSERT_VALUES_EQUAL(acc, 136480896); + UNIT_ASSERT_VALUES_EQUAL(count, 782); } else { UNIT_FAIL("result is not checked"); } |