cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | "nothing compares to the timeshifter, my personal polar expedition in software" - pedronis
<and1>
Hi. Is iteritems() slower in pypy than items() for small dicts?
<ronan>
and1: Probably. Benchmark it?
<and1>
Generally, do generators slow down iterations noticeably compared to iterating raw lists?
<and1>
It's hard to benchmark it since there are a lot of calls for small dicts
<and1>
an artificial benchmark is usually menaningless for a JIT
marr has joined #pypy
tnorth has joined #pypy
<tnorth>
hi there
cstratak has joined #pypy
<tnorth>
CFFI noob question: I have a function void foo(size_t * bar); which writes into bar. Why doesn't this work with cffi: bar = ffi.cast("size_t", 0); bar_ptr = ffi.new("size_t *", bar); foo(bar_ptr)?
<tnorth>
I guess that I'm not using ffi.cast() correctly. Why
<tnorth>
The following works: bar = ffi.new("size_t []", 0); foo(ffi.addressof(bar, 0))
antocuni has joined #pypy
marvin_ has quit [Remote host closed the connection]
marvin has joined #pypy
marvin is now known as Guest28073
mattip_ has joined #pypy
<mattip_>
tnorth: ffi.cast is a cast, not an allocation, so ffi.cast("size_t", 0) is not writeable
adamholmberg has joined #pypy
<tnorth>
mattip_: makes sense, thanks
<tnorth>
how do I allocate a single int then, do i need to make an array of one item?
<mitsuhiko>
fijal: you there? can i bother you about cffi?
<fijal>
mitsuhiko: sure
<mitsuhiko>
right now cffi always invokes the build script
<mitsuhiko>
so even if you invoke `setup.py --version`
<mitsuhiko>
which is okay if the header is a static file shipped
<mitsuhiko>
but i would like to generate the header on the file
<mitsuhiko>
*fly
<mitsuhiko>
so trying to figure out if i can trick it to defer the cdef call
<mitsuhiko>
to when it actually starts building
<fijal>
mitsuhiko: were out for lunch can I answer in 30 min?
<mitsuhiko>
sure. no pressure
squeaky_pl has joined #pypy
<squeaky_pl>
mattip_, how far are we from putting the new release tag on release-pypy3.5-5.x?
<squeaky_pl>
is a cython release the only thing the new release is waiting for?
arigato has joined #pypy
<arigato>
mitsuhiko: I'm not sure I follow. does your cffi build script try to open some file explicitly?
<kenaan_>
rlamy py3.5 011a075b1e24 /lib-python/3/ctypes/test/test_values.py: Skip tests using pythonapi
antocuni has joined #pypy
<ronan>
squeaky_pl: cython 0.27.1 has been released
<mitsuhiko>
@arigato: it’s invoking a subprocess to generate the header
<mitsuhiko>
Which is very slow
<mattip_>
squeaky_pl: actually cpython released, there were some last-minute fixes for pandas+cython and I just now started the builds
<squeaky_pl>
mattip_, thanks, gonna warm up my engines
<mattip_>
so if all is OK, d72f9800a42b should be pypy3.5-v5.9.0
<mattip_>
and 84a2f3e6a7f8 will be pypy2.7-v5.9.0
<mattip_>
unless the builds fail or the people at the sprint discover more issues
<kenaan_>
fijal memory-accounting 4038d01ba9e9 /rpython/translator/backendopt/writeanalyze.py: fix the problem of lazy setfield
amaury has joined #pypy
<tnorth>
hmm why is that invalid: #define FOOBAR ... (in cdef), where in the h file included in set_source() contains #define FOOBAR "foo" ? (work with integer/float types only?)
<fijal>
tnorth: yes, int/float only
<tnorth>
fijal: ok, thanks. How do I access these macros directly then?
<fijal>
tnorth: one "easy" way is to declare a function returning them in set_source
<tnorth>
fijal: yep, that works, many thanks
<fijal>
of course maybe cffi should do that for you, dunno
<arigato>
you can write more directly "static char *const FOOBAR;"
<arigato>
mitsuhiko: trying to unwind the thread here. is it a problem that the build script (run with setup.py) is slow?
traverseda has quit [Ping timeout: 240 seconds]
<mitsuhiko>
arigato: that and that i do not want to run it yet
<mitsuhiko>
effectively i am generating headers as a side effect of compiling my dylib
<mitsuhiko>
since setup.py howver also runs for egg-info and --version etc. it means i compile my project even though someone only asks for the version
<mitsuhiko>
etc.
<mitsuhiko>
and additionally it's something like 5 minute slow :)
<mitsuhiko>
well. worst case
<kenaan_>
antocuni cpyext-nowrapper 5286504e4045 /pypy/module/cpyext/: (antocuni, ronan): rename nowrapper into no_gc: this new flag imply @rgc.no_collect now
<arigato>
you can probably hack around like override the compile() method in a subclass of FFI
<arigato>
...no, it's not even called by setuptools_ext.py
<mitsuhiko>
arigato: so compile is the earliest you need the defs?
traverseda has joined #pypy
mattip_ has left #pypy ["bye"]
aboudreault_ has quit [Quit: Ex-Chat]
the_drow has quit [Ping timeout: 260 seconds]
<kenaan_>
arigo default 1a1441967500 /pypy/module/cpyext/: (ronan, antocuni, arigo) Small change to prepare the subtype_dealloc() attack
<kenaan_>
arigo default 3e50a1272650 /rpython/rtyper/lltypesystem/: (antocuni, arigo) Aaaaah. Found that this simple new test in test_ll2ctypes doesn't actually pass. Fix.
<kenaan_>
arigo default ace97c304a30 /rpython/rtyper/lltypesystem/: (antocuni, arigo) More.
<arigato>
mitsuhiko: basically, I don't know how to do that cleanly
<arigato>
I think you're left with hacking cffi/setuptools_ext.py and change the time when various things occur
<arigato>
and then make a PR to cffi
<mitsuhiko>
hmm
<mitsuhiko>
going to try if i can make this work somehow
oberstet has quit [Read error: Connection reset by peer]
<kenaan_>
rlamy cpyext-nowrapper e99ce0672a27 /pypy/module/cpyext/api.py: (antocuni, ronan) Remove the 'unwrapper' wrapper for no_gc functions
traverseda has quit [Ping timeout: 240 seconds]
realitix has quit [Ping timeout: 240 seconds]
traverseda has joined #pypy
marr has quit [Ping timeout: 248 seconds]
Rhy0lite has joined #pypy
inhahe_ has quit [Ping timeout: 246 seconds]
jacob22 has joined #pypy
jacob22_ has quit [Ping timeout: 258 seconds]
inhahe_ has joined #pypy
yuyichao_ has quit [Ping timeout: 240 seconds]
<squeaky_pl>
5 years ago: running one PyPy translation on my laptop resulted in kernel OOM killing proceses, today: running 4 translations in parallel and working at the same time on my laptop
<marmoute_>
squeaky_pl: you got a new laptop ?
yuyichao_ has joined #pypy
<kenaan_>
rlamy cpyext-nowrapper cdc783955b0e /pypy/module/cpyext/: (antocuni, ronan, arigo around) Make _Py_Dealloc no_gc and fix its calling from RPython