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
wleslie has quit [Quit: ~~~ Crash in JIT!]
asmeurer__ has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 245 seconds]
mattip has quit [Ping timeout: 276 seconds]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asmeurer__ has quit [Quit: asmeurer__]
asmeurer has joined #pypy
jcea has quit [Quit: jcea]
jamesaxl has quit [Quit: WeeChat 2.1]
wleslie has joined #pypy
hotpot33 has joined #pypy
lritter_ has joined #pypy
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/6818 [mattip: force build, py3.6]
mattip has joined #pypy
<mattip> looking at py3.6, there are a number of lib-python tests that show missing DeprecationWarnings, but they work properly untranslated
<mattip> this one for instance
<mattip> python pytest.py pypy/module/_codecs/test/test_codecs.py -k test_warn_escape_decode
<mattip> passes untranslated, is marked as passiing translated -A, but fails for me when I run it
<mattip> python pytest.py -A pypy/module/_codecs/test/test_codecs.py -k test_warn_escape_decode --python=pypy3 # from py3.6
DIRT has joined #pypy
<mattip> it seems to be a unittest failure to properly catach the warning,
<mattip> pypy3 -W always -c "import codecs; codecs.escape_decode(b'\\A')"
<mattip> warns like it should
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/6818 [mattip: force build, py3.6]
asmeurer has quit [Quit: asmeurer]
asmeurer__ has joined #pypy
asmeurer__ has quit [Ping timeout: 265 seconds]
tayfun26 has joined #pypy
simpson has quit [Ping timeout: 256 seconds]
simpson has joined #pypy
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 264 seconds]
dddddd has joined #pypy
realitix has joined #pypy
wleslie has quit [Quit: ~~~ Crash in JIT!]
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 265 seconds]
hotpot33 has quit [Read error: Connection reset by peer]
antocuni has joined #pypy
wleslie has joined #pypy
dpn` has joined #pypy
wleslie has quit [Quit: ~~~ Crash in JIT!]
asmeurer__ has joined #pypy
asmeurer__ has quit [Ping timeout: 260 seconds]
wleslie has joined #pypy
wleslie has quit [Quit: ~~~ Crash in JIT!]
<cfbolz> mattip: a lot of the problems are like this
antocuni has quit [Ping timeout: 260 seconds]
<thnee> arigato: Thanks for your response regarding FreeBSD. I definitely don't mind making a pull request. Just not sure what the solution should be. I am generally against hard coding paths like that, I would prefer that it relies on some system way of finding lib paths. That's why my question is which other parts are relevant to look at when debugging this. Unless there is a specific reason to hard code it for
<thnee> FreeBSD like that, but it seems there is not.
jcea has joined #pypy
asmeurer__ has joined #pypy
<mattip> cfbolz: yeah, just thinking out loud so when I come back to this I can remember how far I got
<cfbolz> mattip: sure. Just saying that imo a lot of the 3.6 features are actually implemented and tests fail for somewhat spurious reasons
asmeurer__ has quit [Ping timeout: 265 seconds]
marky1991 has joined #pypy
inhahe__ has quit [Ping timeout: 264 seconds]
<the_rat> I have a function with a single arg and no side effects that when benchmarked (with timeit, repeat calls with same arg) runs in ~5µs with CPython and ~100ns with PyPy JIT. If I run the same benchmark with @lru_cache I get ~270µs with CPython and ~160ns with PyPy. This might mean that lru_cache effectively slows things down in PyPy. Can someone explain-like-I'm-five what might be a plausible explanation for this?
<cfbolz> the_rat: what does the function do?
<cfbolz> the_rat: The cache makes it necessary to do a dictionary lookup every time you call the function. If the function is simple enough it is cheaper to actually do the computation instead of doing the lookup in the dictionary
<the_rat> cfbolz: the single arg is the root node of a graph, and it does some transformations and topological sorting and returns something a list of objects based on that
adamholmberg has joined #pypy
<the_rat> If it matters, the arg is effectively the same object
<cfbolz> the_rat: can you paste the code somewhere? It sounds like this is somewhat complicated. But I agree with Alex_Gaynor that maybe a more specific version of the decorator would improve this
<the_rat> Unfortunately I cannot share the code, it's tied to some proprietary stuff :( You all gave me very good input, I will try with a simpler caching decorator and with different input sizes
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 268 seconds]
<the_rat> Very interesting! So, a simple dict lookup for id(arg) cut runtime for the cached case to be close to the uncached case for a small input size. The difference becomes noticeable for larger inputs. This means PyPy is extremely effective at eliminating most of the bloat overhead and getting the performance close to the raw algorithm performance. Exciting :)
Rhy0lite has joined #pypy
raynold has quit [Quit: Connection closed for inactivity]
<cfbolz> the_rat: why use id? to make it not keep the argument alive?
<the_rat> cfbolz: because I don't care about __eq__uality testing, only identity. Probably it would have worked the same because I have no __eq__ but I didn't want to think about it so it's more of a mental shortcut for this benchmark
<cfbolz> you could try something even more radical, like having a list of the last three results and not using a dict at all
<the_rat> Oh yes, good idea
marky1991 has quit [Ping timeout: 256 seconds]
antocuni has joined #pypy
<the_rat> That was a precious suggestion, shaved a few more ns. Thanks a lot.
<cfbolz> the_rat: cool
marky1991 has joined #pypy
<cfbolz> Alex_Gaynor: wow, lru_cache is quite impressively heavy
<Alex_Gaynor> cfbolz: IIRC fijal also fought with it once before
<cfbolz> right
<cfbolz> locks, and linked lists, and indeed a lot of allocations
<cfbolz> make we wonder how useful it is even in CPython]
<LarstiQ> maybe better for avoiding network requests than small computations
<Alex_Gaynor> cfbolz: CPython is _very_ slow :-)
<cfbolz> yes yes
<cfbolz> Alex_Gaynor: for my own amusement I measured matrix multiplication recently: https://gist.github.com/cfbolz/caa8299ebd5ab4e1203be1614a64bb54
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholm_ has joined #pypy
adamholmberg has quit [Remote host closed the connection]
mattip has quit [Ping timeout: 256 seconds]
sbauman has quit [Quit: Connection closed for inactivity]
asmeurer_ has joined #pypy
asmeurer_ has quit [Ping timeout: 256 seconds]
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
realitix_ has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
realitix has quit [Ping timeout: 260 seconds]
realitix_ is now known as realitix
inhahe__ has joined #pypy
asmeurer_ has joined #pypy
asmeurer_ has quit [Ping timeout: 255 seconds]
tayfun26 has quit [Quit: tayfun26]
ivh has joined #pypy
<ivh> Hi! I have a general newbie question on cffi (used with cpython3 for now, but cffi docs say to ask here): I simply want to use a handful of existing C-functions, spread over several files, with cffi out-of-line API-mode. When calling ffibuilder.set_source(), do I then need to give the contents of all files as second argument, or put all except the first into the sources=[] kwarg ?
tbodt has joined #pypy
realitix has quit [Quit: realitix]
realitix has joined #pypy
Klowner has quit [Remote host closed the connection]
realitix has quit [Client Quit]
lritter_ has quit [Ping timeout: 248 seconds]
asmeurer__ has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
antocuni has quit [Ping timeout: 268 seconds]
nunatak has joined #pypy
marky1991 has quit [Remote host closed the connection]
hotpot33 has joined #pypy
hotpot33 has quit [Remote host closed the connection]
marky1991 has joined #pypy
asmeurer__ has quit [Quit: asmeurer__]
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tbodt has joined #pypy
tbodt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
asmeurer_ has joined #pypy
Rhy0lite has quit [Quit: Leaving]
asmeurer_ has quit [Quit: asmeurer_]
tbodt has joined #pypy
nunatak has quit [Remote host closed the connection]
realitix has joined #pypy
realitix has quit [Client Quit]
realitix has joined #pypy
marky1991 has quit [Remote host closed the connection]
nanonyme has joined #pypy
<nanonyme> arigato, btw, does CFFI or are you considering it to support Python3 pathlib objects out of the box for library paths?
<cfbolz> nanonyme: that's probably an easy pull request
<nanonyme> Well, yes and no
<nanonyme> There's two separate implementations, one is in C and one is in Python
<nanonyme> I know this because this hits the exact same codepath I earlier filed a bug with getting Windows unicode paths being supported
<nanonyme> The Python-side is reasonably simple to fix, the C part might be painful
<nanonyme> Also CFFI needs to work on Python2 so you need glue code even for os.fspath
realitix has quit [Quit: realitix]
<nanonyme> (to be honest, I always thought it would be nicer if the inline and out-of-line ABI modes shared more code as Python code but anyway)
adamholm_ has quit [Remote host closed the connection]
adamholmberg has joined #pypy
antocuni has joined #pypy
adamholmberg has quit [Read error: No route to host]
speeder39 has joined #pypy
DIRT has quit [Ping timeout: 245 seconds]
wleslie has joined #pypy
jcea has quit [Ping timeout: 276 seconds]
adamholmberg has joined #pypy
jcea has joined #pypy
asmeurer__ has joined #pypy
antocuni has quit [Remote host closed the connection]
asmeurer__ has quit [Quit: asmeurer__]
wleslie has quit [Quit: ~~~ Crash in JIT!]