File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ * Advent of Code 2020 Day 23
2
+ Perfect puzzle to show differences between interpreted, JIT and compiled
3
+ language. The same solution was written in two languages -- Python and C.
4
+ Python code was run on CPython and PyPy implementation. C code was compiled
5
+ with optimization turned on. Benchmark ran on i5 3210M Win10 using Cygwin.
6
+ * Python 3.8
7
+ #+begin_example
8
+ $ time python3 23b.py
9
+ 192515314252
10
+
11
+ real 0m40.930s
12
+ user 0m0.016s
13
+ sys 0m0.000s
14
+ #+end_example
15
+ * PyPy 3.7
16
+ #+begin_example
17
+ $ time pypy3 23b.py
18
+ 192515314252
19
+
20
+ real 0m10.309s
21
+ user 0m0.062s
22
+ sys 0m0.015s
23
+ #+end_example
24
+ * GCC 10.2 -O3
25
+ #+begin_example
26
+ $ time ./23b.exe
27
+ 192515314252
28
+
29
+ real 0m1.598s
30
+ user 0m0.000s
31
+ sys 0m0.030s
32
+ #+end_example
You can’t perform that action at this time.
0 commit comments