Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed Nov 26, 2023
1 parent fe702e8 commit 0abd9e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 7 additions & 8 deletions benchmarks/dataframe_performance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ int main(int, char *[]) {

const auto fourth = high_resolution_clock::now();

df.sort<double, double, double>("log_normal", sort_spec::ascen,
"exponential", sort_spec::ascen);
// df.sort<double, double>("log_normal", sort_spec::ascen);
std::cout << "Number of rows after sort: "
<< df.get_column<double>("normal").size() << std::endl;
// df.sort<double, double, double>("log_normal", sort_spec::ascen,
// "exponential", sort_spec::ascen);
// std::cout << "1001th value in normal column: "
// << df.get_column<double>("normal")[1001] << std::endl;

const auto fifth = high_resolution_clock::now();

Expand All @@ -96,9 +95,9 @@ int main(int, char *[]) {
<< "Selection time: "
<< double(duration_cast<microseconds>(fourth - third).count()) / 1000000.0
<< " secs\n"
<< "Sorting time: "
<< double(duration_cast<microseconds>(fifth - fourth).count()) / 1000000.0
<< " secs\n"
// << "Sorting time: "
// << double(duration_cast<microseconds>(fifth - fourth).count()) / 1000000.0
// << " secs\n"
<< "Overall time: "
<< double(duration_cast<microseconds>(fifth - first).count()) / 1000000.0
<< " secs"
Expand Down
7 changes: 3 additions & 4 deletions benchmarks/polars_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@
print(f"Number of rows after select: {df3.select(pl.count()).item()}")
fourth = datetime.datetime.now()

df4 = df.sort(["log_normal", "exponential"]);
# df4 = df.sort("log_normal");
print(f"Number of rows after sort: {df4.select(pl.count()).item()}")
# df4 = df.sort(["log_normal", "exponential"]);
# print(f"1001th value in normal column: {df4['normal'][1001]}")
fifth = datetime.datetime.now()

print(f"Calculation time: {(third - second).seconds}.{(third - second).microseconds} secs")
print(f"Selection time: {(fourth - third).seconds}.{(fourth - third).microseconds} secs")
print(f"Sorting time: {(fifth - fourth).seconds}.{(fifth - fourth).microseconds} secs")
# print(f"Sorting time: {(fifth - fourth).seconds}.{(fifth - fourth).microseconds} secs")
print(f"Overall time: {(fifth - first).seconds}.{(fifth - first).microseconds} secs")

# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 0abd9e4

Please sign in to comment.