|
Zip and Skip Tries
|
Defines utilities for managing performance data logging and timing. More...
#include <chrono>#include <ctime>#include <string>#include <fstream>#include <iostream>

Go to the source code of this file.
Classes | |
| struct | WallTimer |
A timer class measuring wall-clock time using std::chrono::high_resolution_clock. More... | |
| struct | CPUTimer |
A timer class measuring CPU time used by the current process using std::clock(). More... | |
Variables | |
| static const std::string | GENETIC_DATA_DIRECTORY = "data-genetic/" |
| Directory path for storing data related to genetic datasets. | |
| static const std::string | SYNTHETIC_DATA_DIRECTORY = "data-synthetic/" |
| Directory path for storing data related to synthetic datasets. | |
| static const std::string | SEARCH_DATA_FILENAME = "search-data-" |
| Base filename prefix for search performance data files. | |
| static const std::string | CONSTRUCTION_DATA_FILENAME = "construction-data-" |
| Base filename prefix for construction performance data files. | |
| static const std::string | REMOVAL_DATA_FILENAME = "removal-data-" |
| Base filename prefix for removal performance data files. | |
| static const std::string | CSV_EXTENSION = ".csv" |
| Standard file extension for Comma Separated Value files. | |
| static const std::string | HOSTNAME = get_hostname() |
| Constant string storing the hostname, retrieved once at program startup. | |
Defines utilities for managing performance data logging and timing.
This file provides constants for data directories and filenames, functions for saving performance metrics (search, construction, removal times) to CSV files, and timer classes (WallTimer, CPUTimer) for measuring execution time. It helps in systematically collecting and organizing benchmark results.
Definition in file data.hpp.
|
inline |
Gets the appropriate data directory path based on the data type.
| is_genetic | If true, returns the genetic data directory; otherwise, returns the synthetic data directory. |
Definition at line 36 of file data.hpp.
| std::string get_hostname | ( | ) |
Retrieves the hostname of the machine executing the code.
Implemented by reading from /proc/sys/kernel/hostname on Linux systems.
Definition at line 50 of file data.cpp.
| std::string pretty_print | ( | size_t | nanoseconds | ) |
Converts a duration in nanoseconds to a human-readable string format.
Formats the time into hours (h), minutes (m), seconds (s), and milliseconds (ms) as appropriate.
| nanoseconds | The duration in nanoseconds. |
Definition at line 65 of file data.cpp.
| void save_construction_data | ( | const std::string & | method, |
| size_t | n, | ||
| size_t | m, | ||
| size_t | l, | ||
| size_t | num_nanoseconds, | ||
| size_t | num_repetitions = 1, |
||
| size_t | min_par_compare = 0, |
||
| bool | is_genetic = false |
||
| ) |
Saves construction performance data to a CSV file.
Appends a record to a CSV file named based on the hostname, method, and data type. The file stores parameters and timing results for data structure construction operations.
| method | A string identifying the construction method or data structure used (e.g., "SkipTrie", "ParallelZipTrie"). |
| n | The number of elements inserted during the construction. |
| m | The characteristic length of the elements being inserted (e.g., average or fixed string length). |
| l | A parameter potentially representing the average LCP length of the inserted data, or another characteristic. |
| num_nanoseconds | The total time taken for the construction operation(s), in nanoseconds. |
| num_repetitions | The number of times the construction operation was repeated or batched. Defaults to 1. |
| min_par_compare | A parameter potentially related to parallel comparison thresholds used during construction. Defaults to 0. |
| is_genetic | Flag indicating whether the data pertains to genetic (true) or synthetic (false) datasets. Defaults to false. |
Definition at line 24 of file data.cpp.
| void save_removal_data | ( | const std::string & | method, |
| size_t | n, | ||
| size_t | m, | ||
| size_t | l, | ||
| size_t | num_nanoseconds, | ||
| size_t | num_repetitions = 1, |
||
| size_t | min_par_compare = 0, |
||
| bool | is_genetic = false |
||
| ) |
Saves removal performance data to a CSV file.
Appends a record to a CSV file named based on the hostname, method, and data type. The file stores parameters and timing results for data structure removal operations.
| method | A string identifying the removal method or data structure used (e.g., "SkipTrie", "ParallelZipTrie"). |
| n | The number of elements present before removal or the number of elements removed. |
| m | The characteristic length of the elements being removed (e.g., average or fixed string length). |
| l | A parameter potentially representing the LCP or other characteristic related to the removed elements. |
| num_nanoseconds | The total time taken for the removal operation(s), in nanoseconds. |
| num_repetitions | The number of times the removal operation was repeated or batched. Defaults to 1. |
| min_par_compare | A parameter potentially related to parallel comparison thresholds used during removal. Defaults to 0. |
| is_genetic | Flag indicating whether the data pertains to genetic (true) or synthetic (false) datasets. Defaults to false. |
Definition at line 37 of file data.cpp.
| void save_search_data | ( | const std::string & | method, |
| size_t | n, | ||
| size_t | m, | ||
| size_t | l, | ||
| size_t | num_nanoseconds, | ||
| size_t | num_repetitions = 1, |
||
| size_t | min_par_compare = 0, |
||
| bool | is_genetic = false |
||
| ) |
Saves search performance data to a CSV file.
Appends a record to a CSV file named based on the hostname, method, and data type. The file stores parameters and timing results for search operations.
| method | A string identifying the search method or data structure used (e.g., "SkipTrie", "ParallelZipTrie"). |
| n | The number of elements in the data structure when the search was performed. |
| m | The length of the search key (e.g., number of characters or bits). |
| l | The Longest Common Prefix (LCP) length between the search key and its path/result in the structure. |
| num_nanoseconds | The total time taken for the search operation(s), in nanoseconds. |
| num_repetitions | The number of times the search operation was repeated to get the total time. Defaults to 1. |
| min_par_compare | A parameter potentially related to parallel comparison thresholds (specific meaning depends on context). Defaults to 0. |
| is_genetic | Flag indicating whether the data pertains to genetic (true) or synthetic (false) datasets. Defaults to false. |
Definition at line 11 of file data.cpp.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |