-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cython to speed up some code #80
Comments
Question is can we make it work?
How would we go about. Does it need code rewriting
No dia segunda-feira, 6 de agosto de 2018, Nard Janssens <
[email protected]> escreveu:
… Nice demo of inline Cython:
https://stackoverflow.com/questions/11731428/finding-
first-non-zero-value-along-axis-of-a-sorted-two-dimensional-numpy-array
[image: image]
<https://user-images.githubusercontent.com/11459480/43713325-816d62c0-9979-11e8-8b91-a2dba01a4a55.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKke-mH7YEBVohL881IGQBxvqV01Ifnoks5uOCNXgaJpZM4VqYdm>
.
--
Com os melhores cumprimentos,
Vinicius Silva
|
Well I think a lot can be achieved with smarter coding and parallel processing. This should be a last resort because it would python collaborators to help with programming. |
Another demo calculating mandelbroth images. |
And from docs.cython.org Imagine a simple “hello world” script in a file hello.pyx:
The following could be a corresponding setup.py script:
To build, run python setup.py build_ext --inplace. Then simply start a Python session and do from hello import say_hello_to and use the imported function as you see fit. One caveat if you use setuptools instead of distutils, the default action when running python setup.py install is to create a zipped egg file which will not work with cimport for pxd files when you try to use them from a dependent package. To prevent this, include zip_safe=False in the arguments to setup(). |
Numba is very easy to implement, but not quite as fast as Cython...but very easy to implement
As the author on stackoverflow comments:
|
Stumbled accross Cython which may have some use to speed up PhotonFileEditor.
Nice comparison between Cython, CPython, PyPy and Python.
And here as simple benchmark.
The text was updated successfully, but these errors were encountered: