westonpace commented on code in PR #13426: URL: https://github.com/apache/arrow/pull/13426#discussion_r915308962
########## cpp/src/arrow/compute/exec/asof_join_benchmark.cc: ########## @@ -0,0 +1,1023 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include <stdio.h> +#include <stdlib.h> +#include <condition_variable> +#include <mutex> +#include <string> + +#include "benchmark/benchmark.h" + +#include "arrow/compute/cast.h" +#include "arrow/compute/exec.h" +#include "arrow/compute/exec/expression.h" +#include "arrow/compute/exec/options.h" +#include "arrow/compute/exec/task_util.h" +#include "arrow/compute/exec/test_util.h" +#include "arrow/dataset/partition.h" +#include "arrow/filesystem/api.h" +#include "arrow/ipc/api.h" +#include "arrow/testing/future_util.h" +#include "arrow/testing/generator.h" +#include "arrow/testing/gtest_util.h" +#include "arrow/type.h" + +namespace arrow { +namespace compute { + +static const char* time_col = "time"; +static const char* key_col = "id"; +static bool createdBenchmarkFiles = false; + +// requires export PYTHONPATH=/path/to/bamboo-streaming +// calls generate_benchmark_files to create tables (feather files) varying in frequency, +// width, key density for benchmarks. places generated files in benchmark/data. This +// operation runs once at the beginning of benchmarking. +static void DoSetup() { + if (!createdBenchmarkFiles) { + system( + "mkdir benchmark_data/ && python3 " + "~/summer/bamboo-streaming/bamboo/generate_benchmark_files.py"); + createdBenchmarkFiles = true; + } +} Review Comment: Hmm...we don't have much precedent yet but we do have a few python files scattered amongst the C++ sources. `src/arrow/compute/exec/hash_join_graphs.py` is intended for making graphs from the hash_join benchmarks. However, if you wanted to create a test data directory or scripts directory somewhere in the cpp tree that would probably be ok too. Maybe @pitrou has an opinion here? Rather than using `system()` which is Linux-specific it would be nicer to use something like `boost::process`. You can see an example of this in `s3_test_util.cc` where we launch minio. We should gracefully handle the following: * Python not installed * Python installed but needed dependencies are not We should probably also create a benchmarking.md document or something like that in the `cpp/src/arrow/compute/exec` that explains the tool, what is needed to run it, and what purpose it serves. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
