cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | mac OS and Fedora are not Windows
themsay has quit [Ping timeout: 252 seconds]
dddddd has quit [Remote host closed the connection]
Kipras_ has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
jcea has quit [Remote host closed the connection]
themsay has joined #pypy
Garen has quit [Read error: Connection reset by peer]
Garen has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
Garen_ has joined #pypy
Garen has quit [Ping timeout: 252 seconds]
[0__0] has quit [Remote host closed the connection]
tayfun26 has joined #pypy
Graypup__ has quit [Quit: ZNC 1.6.1 - http://znc.in]
Graypup_ has joined #pypy
tayfun26 has quit [Quit: tayfun26]
tayfun26 has joined #pypy
tayfun26 has quit [Quit: tayfun26]
tayfun26 has joined #pypy
tayfun27 has joined #pypy
tayfun26 has quit [Read error: Connection reset by peer]
jamesaxl has joined #pypy
smvv has joined #pypy
<smvv> is it possible to see what rpython IR opcodes correspond to what asm x64 code? I'm trying to understand why certain asm code is generated. I found MARK_TRACE_ASM but I'm not sure how I can enable that and if that will print a trace of the rpython IR with the generated asm next to it
<smvv> I've set PYPYLOG=jit:pypy.log and disassembled the code in jit-backend-dump using gobjdump
<smvv> I found that some of the generated instructions comes from flush_cc() but the preceding code is a still mystery since many guards can call flush_cc()
<fijal> smvv: you can find the corresponding addresses in jit log
<smvv> jit-backend-addr?
<fijal> yeah
<fijal> still trying to paste a bunch of stuff :-/
<fijal> but yes, jit-backend-addr maps the loop to the address in assembler
<fijal> we put some effort into making vmprof put it all together, but has proven to be hard
themsay has quit [Ping timeout: 240 seconds]
<smvv> fijal: I see the mapping you're mentioning but I was looking for a more fine grained mapping (addresses to rpython IR nodes)
<fijal> that's I think gettable from indexes
<fijal> so on jit-log-backend you have offsets from beginning to the IR
<fijal> on line 397 you have +277 - this is 277 bytes offset from the beginning
<smvv> fijal: awesome!
<fijal> we have some infrastructure to do it for you
<fijal> but it's a bit unclear how to use it all
<smvv> fijal: you mean jitviewer or vmprof?
<cfbolz> smvv: yes, though it's all in various stages of bitrot :-(
dddddd has joined #pypy
lritter has joined #pypy
ceridwen has quit [Ping timeout: 272 seconds]
ceridwen has joined #pypy
jcea has joined #pypy
marky1991 has joined #pypy
Rhy0lite has joined #pypy
adamholmberg has joined #pypy
Cheery has quit [*.net *.split]
kanaka has quit [*.net *.split]
glyph has quit [*.net *.split]
marvin_ has quit [*.net *.split]
ebarrett has quit [*.net *.split]
gsnedders has quit [*.net *.split]
thnee has quit [*.net *.split]
ebarrett has joined #pypy
kanaka has joined #pypy
marvin_ has joined #pypy
thnee has joined #pypy
glyph has joined #pypy
gsnedders has joined #pypy
Cheery has joined #pypy
RemoteFox has joined #pypy
<RemoteFox> hola
<simpson> Hi.
marky1991 has quit [Ping timeout: 268 seconds]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
<RemoteFox> what data type would say is best for bytecodes in my language implemented in rpython?
<RemoteFox> so far I am using list with ints
<RemoteFox> but as I have only a few instructions, I thought it would be better to use something immutable with uints / bytes
<fijal> yes, immutable is much better
<fijal> we usually use strings and read byte by byte
<fijal> makes it more compact, but also you don't have to give extra hints to constant fold away opcode reading when doing JIT
<fijal> RemoteFox: ^^^
<RemoteFox> hah
<RemoteFox> strings didn't occured to me
<RemoteFox> I was thinking more about bytearray or something from https://rpython.readthedocs.io/en/latest/rtyper.html?highlight=struct#array-types
<RemoteFox> but strings make perfect sense
<RemoteFox> thanks
tos9 has quit [Ping timeout: 250 seconds]
tos9 has joined #pypy
kanaka has quit [Changing host]
kanaka has joined #pypy
Zaab1t has joined #pypy
WGH has joined #pypy
tayfun27 has quit [Quit: tayfun27]
cjwelborn has quit [Ping timeout: 250 seconds]
cjwelborn has joined #pypy
marky1991 has quit [Ping timeout: 252 seconds]
Kipras_ has joined #pypy
kenaan_ has joined #pypy
nunatak has joined #pypy
marky1991 has joined #pypy
<lesshaste> is it hard to use pypy with jupyter notebooks?
marky1991 has quit [Remote host closed the connection]
<lesshaste> is it just this?
<lesshaste> pypy -m pip install ipykernel
<lesshaste> pypy -m ipykernel install --name pypy --display-name="Python (PyPy)"
marky1991 has joined #pypy
Ulfalizer has joined #pypy
<smvv> Is it possible that the jump targets of guards are not filled in when the asm x64 code is dumped in the jit-backend-dump section? I'm seeing guards encoded as jumps to the next instrunction instead of going elsewhere on failure https://www.irccloud.com/pastebin/Qd8etWdp/
<smvv> the guards corresponding to those jumps are: https://www.irccloud.com/pastebin/DIJz8r1K/
igitoor has quit [Quit: leaving]
igitoor has joined #pypy
nunatak has quit [Quit: Leaving]
igitoor has quit [Changing host]
igitoor has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
Rhy0lite has quit [Quit: Leaving]
Zaab1t has quit [Quit: bye bye friends]
forgottenone has quit [Remote host closed the connection]
marky1991 has quit [Ping timeout: 268 seconds]
marky1991 has joined #pypy
igitoor has quit [Quit: leaving]
igitoor has joined #pypy
igitoor has quit [Changing host]
igitoor has joined #pypy
marky1991 has quit [Ping timeout: 252 seconds]
<energizer> pypy produces some information about the execution, and then uses that information to make it faster on successive executions of the same part of the code. right?
<simpson> energizer: That's a way of looking at it. What PyPy does is slightly more specific: After a loop has been run many times, PyPy records what happens during one particular run of the loop, and uses that information to do some specialization. That cycle of recording and specializing might happen several times. The hope is that, after specializing, there will be fewer operations.
igitoor has quit [Remote host closed the connection]
<energizer> simpson: ive heard informally that pypy is slower at the beginning of execution than cpython is. i take it that slowness is because it's taking time to record things?
<energizer> (and to produce the specialized version of the loop)
lritter has quit [Quit: Leaving]
<tos9> AFAIK only partially
<tos9> energizer: even if you turn the JIT off, AFAIR, pypy is a bit slower than cpython
<Ulfalizer> energizer: yeah, i see that effect pretty clearly in my program (hand-rolled parsing thing). anecdotally, pypy needs a runtime of at least a few seconds before it overtakes cpython in it.
igitoor has joined #pypy
<energizer> would it be possible to persist that recorded info and use it in another run of the program?
<tos9> energizer: (I don't know what the reasoning is, but presumably it's either that the C that is generated by the rpython backend is slower than the C written by hand for CPython, or that the actual interpreter architecture is more complex. I'd guess possibly the latter, but this is all academic since yeah you use pypy to use the jit :)
<tos9> energizer: if you mean for jitted pypy, AFAIK doing it is super hard (because of garbage collection)
<tos9> but yes in theory it's possible.
<energizer> i see
<energizer> does pypy keep getting faster with longer runtimes, by jitting more and more of the program?
<tos9> energizer: it can, but in modern pypys the jit turns off after awhiel.
<tos9> (intentionally)
<simpson> energizer: IME it doesn't make sense to do blanket comparisons of speed between PyPy and CPython, but rather to profile and tune for a specific application.
<energizer> theoretically you could run your program in multiple process, and then share what they learned with each other for later program runs or even the current program runs?
<tos9> sort of, you run into the same problem as before
<tos9> (that the gc, and the jit in general, emits code with hard addresses in it)
<tos9> so right now no you can't
<tos9> in theory maybe possibly
<simpson> energizer: In theory, sure; in practice, PyPy's JIT doesn't do any kind of sharing or remembering. It's a hard problem in general.
<energizer> mhmm ok
igitoor has quit [Changing host]
igitoor has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
speeder39_ has joined #pypy
themsay has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
igitoor has quit [Ping timeout: 252 seconds]