Skip to content

Commit

Permalink
updating kernels for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
adamamer20 committed Oct 2, 2024
1 parent 7dade71 commit fe74814
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions examples/sugarscape_ig/performance_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,22 @@ def polars_equality_check(a: SugarscapePolars, b: SugarscapePolars):
def main():
# Mesa comparison
sns.set_theme(style="whitegrid")
"""labels_0 = [
labels_0 = [
# "mesa-frames (pd concise)", # Pandas to be removed because of performance
"mesa-frames (pl numba parallel)",
"mesa",
# "mesa-frames (pd concise)",
"mesa-frames (pl concise)",
]
kernels_0 = [
mesa_implementation,
# mesa_frames_pandas_concise,
mesa_frames_polars_concise,
mesa_frames_polars_numba_parallel,
mesa_implementation,
]
n_range_0 = [k for k in range(1, 100002, 10000)]
n_range_0 = [k for k in range(10**5, 5*10**5 + 2, 10**5)]
title_0 = "100 steps of the SugarScape IG model:\n" + " vs ".join(labels_0)
image_path_0 = "benchmark_plot_0.png"
plot_and_print_benchmark(labels_0, kernels_0, n_range_0, title_0, image_path_0)"""
image_path_0 = "mesa_comparison.png"
plot_and_print_benchmark(labels_0, kernels_0, n_range_0, title_0, image_path_0)

# FLAME2-GPU comparison
# mesa-frames comparison
labels_1 = [
# "mesa-frames (pd concise)",
"mesa-frames (pl loop DF)",
Expand All @@ -218,7 +218,6 @@ def main():
]
# Polars best_moves (non-vectorized loop vs DF loop vs numba loop)
kernels_1 = [
# mesa_frames_pandas_concise,
mesa_frames_polars_loop_DF,
mesa_frames_polars_loop_no_vec,
mesa_frames_polars_numba_cpu,
Expand Down

0 comments on commit fe74814

Please sign in to comment.