Skip to content

Commit

Permalink
fix benchmark script
Browse files Browse the repository at this point in the history
  • Loading branch information
thatstoasty committed Sep 24, 2024
1 parent be11da5 commit fb24e13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions benchmarks/string_builder.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ fn main() raises:
report = benchmark.run[benchmark_string_builder[100]](max_iters=20)
report.print(benchmark.Unit.ms)

print("Running benchmark_concat - 1000 batches")
report = benchmark.run[benchmark_concat[1000]](max_iters=20)
report.print(benchmark.Unit.ms)
# print("Running benchmark_concat - 1000 batches")
# report = benchmark.run[benchmark_concat[1000]](max_iters=20)
# report.print(benchmark.Unit.ms)

print("Running benchmark_string_builder - 1000 batches")
report = benchmark.run[benchmark_string_builder[1000]](max_iters=20)
report.print(benchmark.Unit.ms)

print("Running benchmark_concat - 10000 batches")
report = benchmark.run[benchmark_concat[10000]](max_iters=2)
report.print(benchmark.Unit.ms)
# print("Running benchmark_concat - 10000 batches")
# report = benchmark.run[benchmark_concat[10000]](max_iters=2)
# report.print(benchmark.Unit.ms)

print("Running benchmark_string_builder - 10000 batches")
report = benchmark.run[benchmark_string_builder[10000]](max_iters=20)
Expand Down
3 changes: 2 additions & 1 deletion scripts/benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ PACKAGE_NAME=gojo
mkdir -p $TEMP_DIR

echo "[INFO] Building $PACKAGE_NAME package and running benchmarks."
cp -R benchmarks/ $TEMP_DIR
cp -a benchmarks/. $TEMP_DIR
magic run mojo package src/$PACKAGE_NAME -o $TEMP_DIR/$PACKAGE_NAME.mojopkg

echo "[INFO] Running benchmarks..."
magic run mojo $TEMP_DIR/scanner.mojo
magic run mojo $TEMP_DIR/string_builder.mojo
magic run mojo $TEMP_DIR/buffer.mojo

echo "[INFO] Cleaning up the benchmarks directory."
rm -R $TEMP_DIR

0 comments on commit fb24e13

Please sign in to comment.