-
Notifications
You must be signed in to change notification settings - Fork 17
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
improving jitpy #4
Comments
Hi Yann. As a matter of principle, jitpy is as simple as it gets, we want less not more magic happening. So I suggest you distribute your hacks as a separate package and not part of jitpy. That said, maybe passing cffi structures would be a good idea |
support simple tuple, list (single type |
There is a good reason for why lists and dicts can't be passed, but as fijal's latest comment said, it would be possible to extend this simple hack to pass cffi pointers, arrays, and structures. Changes done inside the arrays or structures would be visible to both sides, as CPython and PyPy run in the same process. We'd welcome a pull request that attempts this. |
A ten-minutes demo: https://bitbucket.org/cffi/cffiembed/overview |
@arigo I am kind of n00b to this,
but is it because lists are mutable both in size and each element? What if we pass read only list or dict? |
Yes, it's possible to give a list or dict as read-only (i.e. make a copy for the other side). But at that point it is similar to using pickle or marshal to serialize and deserialize the list or dict. |
Hi,
I really love pypy and jitpy, but for my work, I need to pass complex arguments to pypy functions, not just ints or strings.
So my solution is to convert everything into strings with pickle. Of course it a very dirty hack, but my code still runs many,many times faster than python :-)
It would be great if jitpy could handle all this directly, with some kind of decorator. Unfortunately I don't have enough python/pypy expertise to customize jitpy.
Here is the code I use to send/receive pickled strings.
Best regards,
Yann
The text was updated successfully, but these errors were encountered: