Shubhamkar Ayare
Shubhamkar Ayare
The following python code ```py import time def call_n_times(n): start = time.time() for i in range(n): x = str(i) return time.time() - start print(call_n_times(1000000)) ``` executes about 20 times faster...
Perhaps those should be renamed to `*py-stdout-stream-pipe*` and `*py-stderr-stream-pipe*`, coupled with other corresponding renamings. So, these are only used to send the python's stdout and stderr asynchronously and won't have...
This is up: https://github.com/digikar99/py4cl2-cffi/tree/optim The [three commits alone](https://github.com/digikar99/py4cl2-cffi/compare/master...optim) account for almost a 2x improvement in performance as measured by the `(pycall "str" i)` code above. I have other miscellaneous optimizations...
If you or any reader is interested in this, try stepping through and profiling the function calls involved in pycall-ing. Alternatively, you can contribute to [cl-python](https://github.com/metawilm/cl-python) and make it so...
So, before trying to optimize as much as possible, I think it would also be appropriate to check how fast we can actually go. Here's an attempt: ```lisp (defun fast-pystr...
Here's apparantly the fastest way to do it: ```lisp (defun fast-pystr (o) (declare (optimize speed)) (let* ((pylong (foreign-funcall "PyLong_FromLong" :long o :pointer)) (result (foreign-funcall "PyObject_Str" :pointer pylong :pointer))) result ;;...
Here is the [summary](https://github.com/digikar99/py4cl2-cffi/blob/master/perf-compare/README.org#summary)!
The final goal is to be able to handle `(asdf:load-system "py4cl2-cffi")` with minimal warnings. Not quoting yields a warning about undefined variable `t` when the readtable case used to load...
Currently, there is no native translation for file stream objects. To implement this, one would have to implement a `py4cl2-cffi:pythonize` method returning a pointer to an appropriate CPython object. However,...
Can you confirm that running it straight from the REPL works fine, but running it from an emacs buffer causes lisp to hang? Can you check the output in `*inferior-lisp*`...