Skip to content

Commit

Permalink
Added parallel computing logic to the following visitors: Covariance,…
Browse files Browse the repository at this point in the history
… Variance, Correlation, Standard Deviation, Bets, SEM
  • Loading branch information
hosseinmoein committed Dec 14, 2023
1 parent 4b63bbd commit 6e1f0f4
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 69 deletions.
12 changes: 7 additions & 5 deletions benchmarks/dataframe_performance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ using namespace hmdf;
using namespace std::chrono;

constexpr std::size_t ALIGNMENT = 64;
// constexpr std::size_t SIZE = 300000000;
constexpr std::size_t SIZE = 10000000;
constexpr std::size_t SIZE = 300000000;
// constexpr std::size_t SIZE = 10000000;

typedef StdDataFrame64<time_t> MyDataFrame;

// -----------------------------------------------------------------------------

int main(int, char *[]) {

MyDataFrame::set_optimum_thread_level();

const auto first = high_resolution_clock::now();
MyDataFrame df;

Expand All @@ -64,9 +66,9 @@ int main(int, char *[]) {
VarVisitor<double, time_t> ln_vv;
CorrVisitor<double, time_t> e_ln_cv;

auto mean = df.visit_async<double>("normal", n_mv);
auto var = df.visit_async<double>("log_normal", ln_vv);
auto corr = df.visit_async<double, double>("exponential", "log_normal", e_ln_cv);
auto mean = df.single_act_visit_async<double>("normal", n_mv);
auto var = df.single_act_visit_async<double>("log_normal", ln_vv);
auto corr = df.single_act_visit_async<double, double>("exponential", "log_normal", e_ln_cv);

std::cout << mean.get().get_result() << ", "
<< var.get().get_result() << ", "
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/polars_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# ------------------------------------------------------------------------------

# SIZE: int = 300000000
SIZE: int = 10000000
SIZE: int = 300000000
# SIZE: int = 10000000

first = datetime.datetime.now()
df = pl.DataFrame({"normal": np.random.normal(size=SIZE),
Expand Down
Loading

0 comments on commit 6e1f0f4

Please sign in to comment.