Skip to content

Commit ad0784b

Browse files
authored
Merge pull request #16 from czgdp1807/fixes
Add authors and fix typo in **Conclusion**
2 parents aeb32d2 + 71c683b commit ad0784b

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

content/blog/lpython_mvp.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "LPython: Novel, Fast, Retargetable Python Compiler"
33
date: 2023-07-28
44
tags: ["Python", "Announcement"]
5-
author: "[Ondřej Čertík](https://ondrejcertik.com/), [Brian Beckman](https://www.linkedin.com/in/brianbeckman), [Gagandeep Singh](https://github.com/czgdp1807), [Thirumalai Shaktivel](https://www.linkedin.com/in/thirumalai-shaktivel/), [Smit Lunagariya](https://www.linkedin.com/in/smit-lunagariya-356b93179/), [Ubaid Shaikh](https://Shaikh-Ubaid.github.io/), [Naman Gera](https://github.com/namannimmo10), [Pranav Goswami](https://www.linkedin.com/in/pranavgoswami1/), [Rohit Goswami](https://rgoswami.me), [Dominic Poerio](https://github.com/dpoerio), [Akshānsh Bhatt](https://github.com/akshanshbhatt)"
5+
author: "[Ondřej Čertík](https://ondrejcertik.com/), [Brian Beckman](https://www.linkedin.com/in/brianbeckman), [Gagandeep Singh](https://github.com/czgdp1807), [Thirumalai Shaktivel](https://www.linkedin.com/in/thirumalai-shaktivel/), [Smit Lunagariya](https://www.linkedin.com/in/smit-lunagariya-356b93179/), [Ubaid Shaikh](https://Shaikh-Ubaid.github.io/), [Naman Gera](https://github.com/namannimmo10), [Pranav Goswami](https://www.linkedin.com/in/pranavgoswami1/), [Rohit Goswami](https://rgoswami.me), [Dominic Poerio](https://github.com/dpoerio), [Akshānsh Bhatt](https://github.com/akshanshbhatt), [Virendra Kabra] (https://www.linkedin.com/in/virendrakabra/)"
66
type: post
77
draft: false
88
---
@@ -718,6 +718,8 @@ We compare JIT compilation of LPython to Numba on **summation of all the element
718718
| Python | 3.10.4 |
719719

720720
<br/>
721+
722+
721723
<!-- Add your systems like System - Linux, System - Windows, etc and then add the results for your System in the tables that follow -->
722724

723725
**Summation of all the elements of a 1-D array**
@@ -779,6 +781,8 @@ test()
779781

780782
<br/>
781783

784+
785+
782786
| Compiler | Execution Time (s) | System | Relative |
783787
|---|---|---|---|
784788
| LPython | 0.013 | Apple M1 MBP 2020 | 1.00 |
@@ -791,6 +795,8 @@ test()
791795
| Numba | 0.048 | AMD Ryzen 5 2500U (Ubuntu 22.04) | 1.00 |
792796

793797
<br/>
798+
799+
794800
<!-- TODO: Write a summary of the results -->
795801

796802
**Pointwise multiplication of two 1-D arrays**
@@ -846,6 +852,8 @@ test()
846852

847853
<br/>
848854

855+
856+
849857
| Compiler | Execution Time (s) | System | Relative |
850858
|---|---|---|---|
851859
| Numba | 0.041 | Apple M1 MBP 2020 | 1.00 |
@@ -858,6 +866,8 @@ test()
858866
| LPython | 0.21 | AMD Ryzen 5 2500U (Ubuntu 22.04) | 1.00 |
859867

860868
<br/>
869+
870+
861871
<!-- TODO: Write a summary of the results -->
862872

863873
**Insertion sort on lists**
@@ -929,6 +939,8 @@ test()
929939

930940
<br/>
931941

942+
943+
932944
| Compiler | Execution Time (s) | System | Relative |
933945
|---|---|---|---|
934946
| LPython | 0.11 | Apple M1 MBP 2020 | 1.00 |
@@ -941,6 +953,8 @@ test()
941953
| Numba | 0.36 | AMD Ryzen 5 2500U (Ubuntu 22.04) | 3.60 |
942954

943955
<br/>
956+
957+
944958
<!-- TODO: Write a summary of the results -->
945959

946960
**Quadratic-time implementation of the Dijkstra shortest-path algorithm on a fully connected graph**
@@ -1065,6 +1079,8 @@ test()
10651079

10661080
<br/>
10671081

1082+
1083+
10681084
| Compiler | Execution Time (s) | System | Relative |
10691085
|---|---|---|---|
10701086
| LPython | 0.23 | Apple M1 MBP 2020 | 1.00 |
@@ -1077,6 +1093,8 @@ test()
10771093
| Numba | 1.95 | AMD Ryzen 5 2500U (Ubuntu 22.04) | 2.24 |
10781094

10791095
<br/>
1096+
1097+
10801098
<!-- TODO: Write a summary of the results -->
10811099

10821100
### Ahead-of-Time (AoT) Compilation
@@ -1095,6 +1113,8 @@ Next, we see how LPython compares to other AoT compilers and to the standard CPy
10951113

10961114
<br/>
10971115

1116+
1117+
10981118
**Quadratic-time implementation of the Dijkstra shortest-path algorithm on a fully connected graph**
10991119

11001120
```python
@@ -1235,6 +1255,8 @@ int main() {
12351255
12361256
<br/>
12371257
1258+
1259+
12381260
Note the optimization flags furnished to each compiler.
12391261
12401262
| Compiler/Interpreter | Optimization flags used |
@@ -1246,6 +1268,8 @@ Note the optimization flags furnished to each compiler.
12461268
12471269
<br/>
12481270
1271+
1272+
12491273
<!-- TODO: Write a summary of the results -->
12501274
12511275
**Floyd-Warshall algorithm on array representation of graphs**
@@ -1347,6 +1371,8 @@ int main() {
13471371
| Python | 440.588 | AMD Ryzen 5 2500U (Ubuntu 22.04) | 633.94 |
13481372
13491373
<br/>
1374+
1375+
13501376
<!-- TODO: Remove above line if the following table looks good.-->
13511377
13521378
Note the optimization flags furnished to each compiler.
@@ -1359,6 +1385,8 @@ Note the optimization flags furnished to each compiler.
13591385
| Python | - |
13601386
13611387
<br/>
1388+
1389+
13621390
<!-- TODO: Write a summary of the results -->
13631391
13641392
### Interoperability with CPython
@@ -1599,6 +1627,6 @@ Done.
15991627

16001628
## Conclusion
16011629

1602-
The benchmarks support the claim that LPython is competitive with its competitors in all features it offers. In JIT, the execution times of LPython-compiled functions are at least as short as equivalent Numba functions.The speed of JIT compilation, itself, is slow in some cases because it depends on a C compiler to generate optimal binary code. For algorithms with rich data structures like `dict` (hash maps) and `list`, LPython shows much faster speed than Numba. In AoT compilation for tasks like the Dijkstra algorithm, LPython beats equivalent C++ code very comfortably. For an array-based implementation of the Floyd-Warshall algorithm, LPython generates code almost as fast as doess C++.
1630+
The benchmarks support the claim that LPython is competitive with its competitors in all features it offers. In JIT, the execution times of LPython-compiled functions are at least as short as equivalent Numba functions.The speed of JIT compilation, itself, is slow in some cases because it depends on a C compiler to generate optimal binary code. For algorithms with rich data structures like `dict` (hash maps) and `list`, LPython shows much faster speed than Numba. In AoT compilation for tasks like the Dijkstra algorithm, LPython beats equivalent C++ code very comfortably. For an array-based implementation of the Floyd-Warshall algorithm, LPython generates code almost as fast as C++ does.
16031631

16041632
The main takeaway is that LPython/LFortran generate fast code by default. Our benchmarks show that it's straightforward to write high-speed LPython code. We hope to raise expectations that LPython output will be in general at least as fast as the equivalent C++ code. Users love Python because of its many productivity advantages: great tooling, easy syntax, and rich data structures like lists, dicts, sets, and arrays. Because any LPython program is also an ordinary Python program, all the tools -- debuggers and profilers, for instance -- just work. Then, LPython delivers run-time speeds, even with rich data structures at least as short as alternatives in most cases. In the future, LPython will allow user-defined implementations of data structures for those rare cases where the versions shipped with LPython are not good enough.

0 commit comments

Comments
 (0)