SpecProto is a parallelizing compiler that generates parallel decoders for a given Protobuf schema.
Our experiments ran on a server node with two Intel Xeon E5-2683 v4 processors and 512GB RAM. Unless otherwise specified, all parallel executions will use a single socket with 16 threads. This server runs on Rocky 8 and is installed with G++ 9.2.1. All programs are compiled with O3 optimization. The timing results reported are the average of five repetitive runs.
Please ensure that the machine has 16 physical CPU cores and at least 16 GB of memory.
If you are using HPC, you can use the following command to get a shell with 32 cores and 16GB memory. (Exclusive mode is recommended to avoid resource contention.)
srun --mem=16gb --cpus-per-task=32 -p intel --nodes=1 --ntasks=1 --time=2:00:00 --exclusive --pty bash -l
module load gcc@9.2.1This project installs protobuf locally into the repository.
Before running the installation script, make sure the following tools are available:
gitcmake(tested withcmake 3.26.4)- A C++ compiler (tested with
g++ 9.2.1)
git --version && cmake --version && g++ --versionOn Debian/Ubuntu systems, the required tools can be installed with:
sudo apt update
sudo apt install -y git cmake build-essentialThen install protobuf locally:
./script/install_protobuf.shTested with Python 3.9:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .Setup the project:
make setupDownload datasets from Google Drive and place them in ./dataset.
We have encapsulated the detailed commands for running the experiments in Makefile, which calls Python scripts to execute the experiments and generate the results. Below, for each experiment, we provide a corresponding make command to run the experiment and produce the results.
make gen_parallel_pbs
make build_allNote impl=bl is the baseline implementation. impl=tpp is the non-speculative implementation. impl=spp is the speculative implementation.
make overall_execution_time
make overall_execution_time_figThe results will be saved in ./artifact/result/overall_execution_time.csv and ./artifact/figure/overall_execution_time.pdf.
make memory_overheadThe results will be saved in ./artifact/result/memory_overhead.csv.
make time_breakdown_spec
make time_breakdown_spec_figThe results will be saved in ./artifact/result/time_breakdown_spec.csv and ./artifact/figure/time_breakdown_spec.pdf.
First, we need to generate and build the code with statistics enabled:
make gen_parallel_pbs
make build_all BUILD="build/stat" DEFINE="-DCOUNT_REDO_BYTES -DCOUNT_VISITED_BYTES"Then, run the experiment:
make cost_breakdown_specThe results will be saved in ./artifact/result/cost_breakdown_spec.csv. Note the statistics may not be exactly the same as the ones in the paper due to update of the code generation.
First, we need to generate and build the code with disabled type prioritization:
make gen_parallel_pbs GEN_OPTIONS="--disable_type_prioritization"
make build_all BUILD="build/disable_type_prioritization"Then, run the experiment:
make benefits_of_type_prioritization
make benefits_of_type_prioritization_figThe results will be saved in ./artifact/result/benefits_of_type_prioritization.csv and ./artifact/figure/benefits_of_type_prioritization.pdf.
make scalability_over_threads
make scalability_over_threads_figThe results will be saved in ./artifact/result/scalability_over_threads.csv and ./artifact/figure/scalability_over_threads.pdf.
make scalability_over_size
make scalability_over_size_figThe results will be saved in ./artifact/result/scalability_over_size.csv and ./artifact/figure/scalability_over_size.pdf.
make gen_parallel_pb PREFIX=pprof_profile
make build PREFIX=pprof_profile
make run TEST_MODE=C DATASET=pprof_profile IMPL=spp THREADS=16Note TEST_MODE=C is the check mode (i.e., compare the results with the standard parser to test the correctness). TEST_MODE=B is the benchmark mode.
To run your own schema and dataset, you should first put the schema and dataset in ./schema and ./dataset respectively. Then, run the following command to generate and build the code:
make gen_parallel_pb PREFIX=your_schema
make build PREFIX=your_schemaThen, run the following command to run the test:
make run TEST_MODE=C DATASET=your_dataset IMPL=spp THREADS=16Note currently we support a simplified Protobuf schema. The package should be PB and the first message should be the main message. Please refer to ./schema/pprof_profile.proto for an example.