Skip to content

Commit d261049

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

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

problem-1/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ Link: https://leetcode.com/problems/length-of-last-word/description/
66

77
Benchmark 1: python3 problem-1.py
88
Time (mean ± σ): 11.1 ms ± 1.6 ms [User: 9.4 ms, System: 1.8 ms]
9-
Range (min … max): 8.8 ms … 22.1 ms 212 runs
109

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.
10+
Range (min … max): 8.8 ms … 22.1 ms 212 runs
1211

12+
1313
Benchmark 2: mojo problem-1.mojo
14+
1415
Time (mean ± σ): 222.3 ms ± 9.7 ms [User: 238.4 ms, System: 28.6 ms]
16+
1517
Range (min … max): 205.5 ms … 238.0 ms 14 runs
1618

1719
# Which performed better?

problem-2/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ Link: https://leetcode.com/problems/student-attendance-record-i/description/
55
# Benchmarks
66

77
Benchmark 1: python3 problem-2.py
8+
89
Time (mean ± σ): 11.9 ms ± 2.2 ms [User: 9.8 ms, System: 2.2 ms]
10+
911
Range (min … max): 8.8 ms … 23.0 ms 316 runs
1012

1113
Benchmark 2: mojo problem-2.mojo
14+
1215
Time (mean ± σ): 236.4 ms ± 5.3 ms [User: 259.6 ms, System: 21.9 ms]
16+
1317
Range (min … max): 228.0 ms … 243.9 ms 12 runs
1418

1519
# Which performed better?

0 commit comments

Comments
 (0)