cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
Garen has quit [Read error: Connection reset by peer]
Garen has joined #pypy
dddddd has quit [Remote host closed the connection]
altendky has quit [Quit: Connection closed for inactivity]
altendky has quit [Quit: Connection closed for inactivity]
fryguybob has quit [Quit: leaving]
fryguybob has joined #pypy
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 255 seconds]
tbodt has joined #pypy
Garen has quit [Read error: Connection reset by peer]
<tsutsumi>
Hi, just out of curiosity: what's the reason behind the expensive cost of cpyext? It feels like pypy not being able to fully take advantage of optimizations like cython limit where it can be used
<tsutsumi>
or rather, forcing one to choose one or the other. Is there a way to theoretically improve that communication cost?
Garen has joined #pypy
<mdash>
tsutsumi: cpyext has to simulate cpython internals
<mdash>
tsutsumi: pypy has different internals, since it's designed for speed and cpython isn't
<mdash>
tsutsumi: cython is only needed for optimization because cpython is slow
<tsutsumi>
yeah, I see that in many cases cython optimizations won't be necessary
<tsutsumi>
but libraries that have cython optimizations built in for hot paths will be slower in pypy
<mdash>
possibly
<mdash>
which ones do you have in mind?
<LarstiQ>
tsutsumi: doesn't cython have some pypy support?
dddddd has joined #pypy
<tsutsumi>
which means I have to omit anything that utilizes cython heavily, for example https://vibora.io/
<LarstiQ>
tsutsumi: but the general concern is: optimizing for cpython can deoptimize for pypy
<LarstiQ>
not just cython
<tsutsumi>
yes, in general I am concerned about that
asmeurer has joined #pypy
<tsutsumi>
cython does support cpyext, but I've been told by members in this room that heavy use of cpyext is a perf hit, and thus optimizing high utilization paths in cython can have a negative perf hit in pypy
<tsutsumi>
specifically if there's a lot of cython calls
<tsutsumi>
are there other situations there optimizing for cpython could impact pypy negatively? I think in general how you write python code doesn't matter since, as long as it's simple, it can be jitted anyway
<LarstiQ>
hmm, cpyext you get by default from targeting cpython, pypy support would be _not_ using cpyext
<tsutsumi>
ah, I see what you mean
<LarstiQ>
but I don't know what cython has done lately
<tsutsumi>
from what I understand, it's using cpyext still
<tsutsumi>
it's a good point though, that cython could just take a different approach for pypy
<LarstiQ>
tsutsumi: yes, e.g. how to concatenate strings
<LarstiQ>
lru.cache can be a large hit on pypy
<simpson>
tsutsumi: Cython *should* absolutely have a mode that emits pure Python which runs decently on PyPy. I'm not sure why it (still?) doesn't.
<tsutsumi>
probably just no one has volunteered to put the time in... probably an idea that was run by them, although I don't see it in the github issues
<tsutsumi>
I suppose it wouldn't just compile to any vanilla python either: it would be syntax that will jit really well, to ensure that pypy can basically optimize to similar to performance
<tsutsumi>
of cython code
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tsutsumi>
okay, seems like if one was going to improve cython - pypy performance, that would be the right strategy to take.
<tsutsumi>
thanks for the insight!
tbodt has joined #pypy
asmeurer has quit [Ping timeout: 264 seconds]
lritter_ has quit [Quit: Leaving]
altendky has joined #pypy
asmeurer has joined #pypy
nunatak has quit [Quit: Leaving]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]