Mark up files & directories

This commit is contained in:
Zearin
2014-04-11 11:26:37 -04:00
parent a604dd1095
commit cc7b19356e
13 changed files with 69 additions and 68 deletions
+4 -4
View File
@@ -150,8 +150,8 @@ to be compiled into C types while also creating a Python list:
What is the difference? In the upper Cython version you can see the declaration of the variable types and the integer array
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)
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in `*.py` files,
Cython code is saved in `*.pyx` files.
allows the Cython compiler to generate more efficient C code from the second code. While standard Python code is saved in :file:`*.py` files,
Cython code is saved in :file:`*.pyx` files.
And what is with the speed? So lets try it!
@@ -187,9 +187,9 @@ These both lines need a remark:
pyximport.install()
The `pyximport` module allows you to import `pyx` files (e.g., `primesCy.pyx`) with the Cython-compiled version of the `primes` function.
The `pyximport` module allows you to import :file:`*.pyx` files (e.g., :file:`primesCy.pyx`) with the Cython-compiled version of the `primes` function.
The `pyximport.install()` command allows the Python interpreter to start the Cython compiler directly to generate C-code,
which is automatically compiled to a `*.so` C-library. Cython is able to import this library for you in your Python-code.
which is automatically compiled to a :file:`*.so` C-library. Cython is able to import this library for you in your Python-code.
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.
On a standard notebook (dual core AMD E-450 1.6 GHz), the measured values are: