You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/scenarios/speed.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,8 +150,8 @@ to be compiled into C types while also creating a Python list:
150
150
151
151
What is the difference? In the upper Cython version you can see the declaration of the variable types and the integer array
152
152
in a similar way like in standard C. For example `cdef int n,k,i` in line 3. This additional type declaration (e.g. integer)
153
-
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in `*.py` files,
154
-
Cython code is saved in `*.pyx` files.
153
+
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in :file:`*.py` files,
154
+
Cython code is saved in :file:`*.pyx` files.
155
155
156
156
And what is with the speed? So lets try it!
157
157
@@ -187,9 +187,9 @@ These both lines need a remark:
187
187
pyximport.install()
188
188
189
189
190
-
The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) with the Cython-compiled version of the `primes` function.
190
+
The `pyximport` module allows you to import :file:`*.pyx` files (e.g., :file:`primesCy.pyx`) with the Cython-compiled version of the `primes` function.
191
191
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
192
-
which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
192
+
which is automatically compiled to a :file:`*.so` C-library. Cython is able to import this library for you in your Python-code.
193
193
Very easy and very efficient. With the `time.time()` function you are able to compare the time between this 2 different calls to find 500 prime numbers.
194
194
On a standard notebook (dual core AMD E-450 1.6 GHz), the measured values are:
0 commit comments