Skip to content

Commit b4defa2

Browse files
authored
Comparison between Mojo and Python
1 parent d261049 commit b4defa2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

problem-1/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Link: https://leetcode.com/problems/length-of-last-word/description/
55
# Benchmarks
66

77
Benchmark 1: python3 problem-1.py
8+
89
Time (mean ± σ): 11.1 ms ± 1.6 ms [User: 9.4 ms, System: 1.8 ms]
910

1011
Range (min … max): 8.8 ms … 22.1 ms 212 runs
@@ -13,7 +14,7 @@ Benchmark 1: python3 problem-1.py
1314
Benchmark 2: mojo problem-1.mojo
1415

1516
Time (mean ± σ): 222.3 ms ± 9.7 ms [User: 238.4 ms, System: 28.6 ms]
16-
17+
1718
Range (min … max): 205.5 ms … 238.0 ms 14 runs
1819

1920
# Which performed better?

problem-4/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ Link: https://leetcode.com/problems/detect-capital/description/
55
# Benchmarks
66

77
Benchmark 1: python3 problem-4.py
8+
89
Time (mean ± σ): 11.1 ms ± 1.3 ms [User: 9.6 ms, System: 1.7 ms]
10+
911
Range (min … max): 9.8 ms … 17.4 ms 260 runs
1012

11-
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
13+
1214

1315
Benchmark 2: mojo problem-4.mojo
16+
1417
Time (mean ± σ): 230.1 ms ± 10.1 ms [User: 249.7 ms, System: 26.7 ms]
18+
1519
Range (min … max): 215.3 ms … 252.0 ms 13 runs
1620

1721
# Which performed better?

0 commit comments

Comments
 (0)