ArchDebian has quit [Ping timeout: 240 seconds]
yuyichao_ has quit [Ping timeout: 240 seconds]
jneen has joined #pypy
marr has quit [Ping timeout: 240 seconds]
<jneen> hey all - tulip's back to using rpython after some fruitless attempts at wholesale compiling it to llvm whee
<jneen> i mention it because tulip is apparently listed on the rpython docs page, which used to be not accurate but now is again
ArchDebian has joined #pypy
yuyichao_ has joined #pypy
kipras is now known as kipras`away
jcea has quit [Quit: jcea]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
zware has joined #pypy
masoug has joined #pypy
masoug has quit [Quit: Leaving.]
Samureus has joined #pypy
Samureus has quit [Quit: Leaving]
ArchDebian has quit [Ping timeout: 240 seconds]
ArneBab_ has joined #pypy
ArchDebian has joined #pypy
ArneBab has quit [Ping timeout: 240 seconds]
pilne has quit [Quit: Quitting!]
<simpson> Hm. Who was using attrs with RPython? I could have sworn that somebody says that it Just Works and I am curious about their setup.
<tos9> Uh. I probably said that
<simpson> tos9: It didn't Just Work but I bet I did something wrong.
<tos9> But I also probably said that I only use it for reprs
<simpson> SomeInstance(can_be_None=False, classdef=typhon.objects.root.Object)
<simpson> SomeInstance(can_be_None=False, classdef=attr._make.Attribute, const=Attribute(name='target', default=NOTHING, validator=None, repr=True, cmp=True, hash=True, init=True, convert=None))
<simpson> Aw, so you don't use it for .__init__()?
<tos9> simpson: yeah :/
<simpson> Well, curses. I was really hoping that this was a thing.
<tos9> simpson: E.g. https://github.com/Magnetic/cycy/blob/master/cycy/cli.py#L33-L64 is characteristic (and that whole project), but I bet the same works with attrs, and Im pretty sure I've tried it before, but yeah not for __init__ unfortunately
<tos9> I think arigato when we had this conversation said something like that he suspects attrs is close to workable
<simpson> Okay. Well, I'd be super-interested in this.
<simpson> 'Cause I'm really tired of writing ._
<simpson> See? My fingers won't even type it.
ArchDebian has quit [Quit: Konversation terminated!]
masoug has joined #pypy
jacob22_ has quit [Quit: Konversation terminated!]
<masoug> question about JitDriver: does the `is_recursive` flag allow more than one jitdriver to exist in an interpreter?
<masoug> is it recursive because it allows one driver to trace while another one is also tracing the same code paths?
<simpson> Yes. I don't know whether the flag is needed.
<masoug> what happens when two drivers share the same code paths i.e. running at the same time?
<masoug> do they both trace the same things or is there some automatic coordination between them?
<simpson> I think that the JIT takes a lock before tracing. Not sure though.
jamadden has quit [Quit: Leaving.]
lritter has joined #pypy
realitix has joined #pypy
inhahe_ has quit [Read error: Connection reset by peer]
<LarstiQ> jneen: welcome back!
<LarstiQ> jneen: is there some writeup about the switches between rpython and llvm?
realitix has quit [Ping timeout: 240 seconds]
jacob22_ has joined #pypy
inhahe_ has joined #pypy
realitix has joined #pypy
vkirilichev has joined #pypy
amaury has joined #pypy
marky1991 has quit [Ping timeout: 240 seconds]
arigato has joined #pypy
vkirilichev has quit [Remote host closed the connection]
<realitix> Hi arigato and fijal, I'm selected to present CFFI at PyParis !
<arigato> realitix: cool :-)
arigato has quit [Ping timeout: 240 seconds]
amaury has quit [Ping timeout: 260 seconds]
<realitix> by the way arigato, I did another wrapper (with cffi) that you could tweet on pypy twitter acount https://github.com/realitix/pyshaderc (the original project (shaderc) references pyshaderc in its Readme)
arigato has joined #pypy
<fijal> hi
cstratak has joined #pypy
vkirilichev has joined #pypy
kolko has quit [Ping timeout: 255 seconds]
antocuni has joined #pypy
<arigato> hi
<antocuni> hi
kolko has joined #pypy
<fijal> so maaaybe I have a better idea how much things are used ;-)
<fijal> ok, so A LOT of strings are really not used
<fijal> that is, unicode_w is never called on them
<fijal> (but they might be stored somewhere)
<fijal> it makes sense, e.g. you parse the headers and create headers dict
<fijal> but not *actually* ever read most of them
masoug has quit [Quit: Leaving.]
marr has joined #pypy
inhahe_ has quit []
inhahe_ has joined #pypy
Tiberium has joined #pypy
<fijal> pom pom pom
inhahe_ has quit [Read error: Connection reset by peer]
<fijal> arigato: I'm trying to think what I can do with this knowledge
<fijal> maybe we can somehow specialize on strings used all the time, but even doing counters seem hard
<arigato> yes, that was my question: what do want to do with this info?
<fijal> arigato: I'm kind of trying to find out how useful would it be to have, say, virtualized count
<fijal> or capitalize
<fijal> can we avoid creating intermediate strings in some cases?
<fijal> but I'm not sure if the data I got actually supports anything :)
<fijal> but I also wanted to find out what are the patterns of usage of getitem
* fijal looks into unicode-sse stuff
<fijal> plan_rich_: ping?
inhahe_ has joined #pypy
<mattip> hi
<arigato> hi
<fijal> mattip: hi matti
<mattip> progress with pandas/cython - I found where the TypeError becomes a ValueError on PyPy
<LarstiQ> mattip: nice
* fijal ponders if he should wait for plan_rich or try to debug the problems with fast-str-methods
antocuni has quit [Ping timeout: 260 seconds]
arigato has quit [Quit: Leaving]
jamadden has joined #pypy
jacob22_ has quit [Quit: Konversation terminated!]
<plan_rich_> fijal, hi
<plan_rich_> yes I'm alive, though I only find time to do vmprof related fixing...
<plan_rich_> what is the problem with fast-str-methods?
<cfbolz> jneen: (probably wrong timezone, but anyway) cool :-). if we can do anything to help, please let us know! also, I'd be interested in knowing what went wrong with llvm? we also had trouble effectively using llvm, at various points
plan_rich_ has left #pypy ["Leaving"]
plan_rich_ has joined #pypy
jacob22_ has joined #pypy
antocuni has joined #pypy
arigato has joined #pypy
realitix has quit [Ping timeout: 245 seconds]
stevi3 has joined #pypy
jcea has joined #pypy
John has joined #pypy
<John> hi all, I need some help taking a numpy array of raw bytes, say 10 bytes, and parsing out 4 letters of DNA per byte into a new array
<John> I can do this in python, but it's quite slow, and i'm trying to show that PyPy, or at least Python, can be very performant when it counts
<John> So i think i need to operate on this numpy array via CFFI, and while I can do that, i don't know how to take 10 bytes and produce 40 values
Tiberium has quit [Remote host closed the connection]
<John> If anyone would be able to help me, your 10 minutes might save me a week, so i'd be very grateful, but i also appreciate everyone's busy with their own stuff too
<dash> John: mmm. What parts of your project need numpy?
<John> I could provide working Python code, and it just has to be made faster if that helps?
<dash> John: As opposed to, say, lists or strings
<John> Hey dash
Tiberium has joined #pypy
<dash> John: Sure, couldn't hurt.
<John> I have a huge number of identical-length strings (DNA), and i can encode it quickly, but my decoder is for whatever reason a lot slower than my encoder -_-
<John> I have a feeling you know about bioinformatics... is that the case?
<dash> I've heard of it. ;-)
<John> Ah ok :) I guess perhaps i jut recognise your handle/alias from #python
<John> hehe
Tiberium has quit [Remote host closed the connection]
<John> Well yeah, i don't really need numpy at all. But i don't know how to do performant bit shifting in C (and in python its not likely to be possible)]
amaury has joined #pypy
<bremner> (x << bits) is as performant as it gets, no?
<bremner> or maybe you mean something more complex by "bit shifting"
<John> No that's basically it, but i'd have thought there'd be something more performant than
Tiberium has joined #pypy
<bremner> I'd imagine that's one machine instruction on x86
<bremner> unless x is bigger than a machine word
<antocuni> John: can you just read them as strings and use struct.unpack/unpack_from?
<antocuni> struct.unpack is very fast on pypy
<John> struct only works on 4/8/16/32 bit numbers, and i've got 2/3/4/5... bit numbers, which is why i can't use that or array.array, etc
<John> As for <<, yeah I guess it's one instruction, which means to unpack an array of things you'd do:
<John> OK first you'd convert the string into a number, because you can't bitshift strings. This would be a pain but it's not impossible (just got to read a byte, add it to the int, shift the int right 8 bits, repeat)
<antocuni> ah I see
<John> Then once it's a number that python will let you bitshift, you have to do something like "for x in range(0,the_number.bit_length(),2): (the_number >> x) & 0xff"
<John> so that's a lot of extra work i guess
<antocuni> well, it's basically the same work that numpy has to do
<John> oh, my 0xff is wrong, that should just be 0b11
<John> antocuni: right, exactly
<John> But i think in CFFI, someone could whip up something that worked much faster
<antocuni> pypy is able to optimize all these ops very well, so I expect the pure-python version to be as fast as the C version
<John> And i don't usually so blatantly ask for help, but I don't really have the week it will take me to figure it out in C
<John> Maybe, yeah, maybe
<antocuni> John: for example, look at this: https://github.com/antocuni/capnpy/blob/master/capnpy/ptr.py#L50
<antocuni> capnpy does this bitshift and masks very often, and the performance on pypy are excellent
<John> Ooh, a Cap'n'proto for python
<John> i should have just used that :P
<John> Does Cap'n'proto do structs?
<antocuni> what do you mean?
<John> I mean, i thought it was a messaging protocol, but if it could be used like a numpy array
<John> in the sense that you can jump to a given row
<antocuni> no, not at all
<John> strides or whatever
<John> ah ok
<antocuni> they messages have to be encoded in a capnproto-specific format
<LarstiQ> John: antocuni was just showing you an example of pypy being fast with shifts
<John> yeah yeah, i got it - I just thought, hey, maybe i should get in on this
<John> OK i'll try optimising my decoder in pypy :)
* John has faith
<dash> John: the rule is that python is fast, C is slow, so don't call C extensions like numpy or things in cffi if you want speed :)
yuyichao_ has quit [Ping timeout: 272 seconds]
<John> Hehehe, oh man i know - but cffi is really really fast for arrays
<John> Like, i don't think i could make a struct faster in pure python
<John> I mean, i guess i could make a string... hm.
<dash> try it anyway :)
lritter has quit [Quit: Leaving]
[Arfrever] has quit [Ping timeout: 268 seconds]
<antocuni> John: if you manage to stay in python it has chances to be faster
<antocuni> because python strings are managed by the GC, while cffi strings are managed by malloc()
<antocuni> and the GC is much faster
<John> I think the issue is that strings aren't mutable
<John> So writing to a string would be a mess
<John> I think the pypy guys tried making special string things, but i don't know how fast they got it or if it's depreciated, etc
<antocuni> ah, you also need to *write* them?
<antocuni> in that case, you can use struct.pack_into and a bytearray
<antocuni> which is slow right now
<antocuni> but it'll be super fast as soon as I finish the faster-rstruct-2 branch :)
<John> oh nice :D
<John> If you do that i'm going to have to re-run all my speed tests -_-;
<John> hehehe
<John> But that's a very worth-while cause, as 99% of the time, i'm only using numpy to get quick array access of structured data
marky1991 has joined #pypy
[Arfrever] has joined #pypy
<antocuni> (in this example, only "decode" is written to be fast on PyPy, but you can write encode in a similar way of course)
<John> right right, but the magic here is in the "val = struct.unpack('H', s)[0]"
<John> if your array wasn't 16 bits, but was 160 bits, this would take way longer to make the int
<John> but the bit shifting i accept is fast as hell :)
<antocuni> well no, of course if you have 160 bits you unpack in steps of 64 bits
<John> oh, hehe, derp - i was unpacking in steps of 8 bits
<John> well there's a performance boost right off the bat
<antocuni> but is the record really 160 bits? O_o
<antocuni> I expected it to be a multiple of 64 anyway
<John> well my encoder takes a random max length of DNA
<John> And there can be any number of letters of DNA, so each letter can be stored in 2bits, 3bits, 4bits, etc. that's variable
<John> Once the bit-length per letter is known, and the max string length is known, the table can be made thats as wide as the smallest number of bytes needed
<John> So if you needed to store 100 letters, 2bits per letter, that's 200 bits
<John> oh that's exactly 25 bytes
<John> ok say 101 letters, that's 202 bits
<John> 25bytes + 2bits, so 26bytes in the array
<antocuni> yes but if you serialize it to a file, you might want to align them to 64 bit boundaries anyway (padding with 0s), if you care about speed
<John> Hm. it could cost me up to 62 extra bits per entry, and i typically have a million entries or so :(
<John> I guess that's only 62 megabytes
<John> no, megabits
<antocuni> as usual, it's a tradeoff between speed and space :)
<John> hehe, yeah :( Sucks we can't have our cake and eat it
<antocuni> anyway, I suggest you to play along the lines of what I pasted above, I think this is the fastest you can do on pypy
<John> ok, i'll give it a shot
<John> thanks for your help man :)
<antocuni> you're welcome
* antocuni back to the faster-rstruct-2 branch :)
realitix has joined #pypy
black_ant has joined #pypy
<mattip> ok, down to 270 pandas test failures, out of 8800 tests run, it seems basically usable
<mattip> after this pull request to cython https://github.com/cython/cython/pull/1704
<antocuni> mattip: hoorray
<mattip> this gist summarizes the failures left to fix
agronholm has quit [Ping timeout: 255 seconds]
agronholm has joined #pypy
<mattip> bye
mattip has left #pypy ["bye"]
adamholmberg has joined #pypy
<kenaan> tobweber stmgc[c8-adaptive-trx-length-per-thread] daf9d599a698 /c8/: Use double instead of float
<kenaan> tobweber stmgc[c8-adaptive-trx-length-per-thread] 66afe82c56ce /c8/stm/core.c: Fix nested measurement of waiting time and time in validation; fix transaction ...
oberstet2 has joined #pypy
vkirilichev has quit [Ping timeout: 260 seconds]
vkirilichev has joined #pypy
[Arfrever] has quit [Ping timeout: 240 seconds]
vkirilic_ has joined #pypy
vkirilichev has quit [Read error: Connection reset by peer]
<fijal> plan_rich_: around?
<kenaan> antocuni faster-rstruct-2 4be2157b169f /rpython/rtyper/: WIP: start to implement llop.gc_store_indexed; still missing implementation in the C backend and the JIT
<kenaan> antocuni faster-rstruct-2 1520c1ffb68f /rpython/rtyper/test/test_llop.py: bah, actually TEST the rtyping of gc_store_index, and fix it
<kenaan> antocuni faster-rstruct-2 884703561c51 /rpython/translator/c/: test and implement gc_store_indexed in the C backend
<kenaan> antocuni faster-rstruct-2 0f9bab52cf32 /rpython/jit/: WIP: start to add support for llop.gc_store_indexed in the JIT, which means to add stuff a bit everywhe...
<kenaan> antocuni faster-rstruct-2 0b70e69aebec /rpython/: hoorray! Implement the last bits of gc_store_indexed in llgraph and finally the test passes :)
<kenaan> antocuni faster-rstruct-2 84c40c5d2545 /rpython/: add JIT support for gc_store_indexed of floats
<kenaan> antocuni faster-rstruct-2 a735e006ad8a /rpython/: add a passing test for single floats
<kenaan> antocuni faster-rstruct-2 d5941a454db5 /rpython/: shuffle the order of arguments of llop.gc_store_indexed to match the existing rop.GC_STORE_INDEXED
<kenaan> antocuni faster-rstruct-2 88ae2f6e9df5 /rpython/jit/: implement support for gc_store_indexed also in llsupport: this fixes the tests for the x86 backend, and...
<kenaan> antocuni faster-rstruct-2 ca663c6eea4d /rpython/jit/backend/arm/test/test_llop.py: add the llop test also for ARM
stevi3 has quit [Quit: Connection closed for inactivity]
oberstet2 is now known as oberstet
John has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<plan_rich_> fijal, yes but on mobile
jamesaxl has joined #pypy
girish946 has joined #pypy
girish946 has quit [Read error: Connection reset by peer]
realitix has quit [Ping timeout: 260 seconds]
<fijal> plan_rich_: do you have any clue why neither tests nor benchmarks work on fast utf8 methods?
realitix has joined #pypy
Tiberium has quit [Remote host closed the connection]
realitix has quit [Quit: Leaving]
<plan_rich_> fijal they should
<plan_rich_> on mac there is an issue when you use a python that is a wide unicode build
<fijal> ok?
vkirilic_ has quit [Remote host closed the connection]
vkirilichev has joined #pypy
vkirilichev has quit [Ping timeout: 240 seconds]
<plan_rich_> as far as I remember it is because every string char is stored as two bytes
<plan_rich_> i recompiled a fresh python 3 and then it worked
<kenaan> antocuni faster-rstruct-2 77c4134d96d9 /rpython/rlib/: implement MutableStringBuffer.typed_write
<kenaan> antocuni faster-rstruct-2 196fb3e1e9b3 /rpython/rlib/rstruct/: finally! Add a fastpath for packing ints :)
arigato has quit [Quit: Leaving]
Tiberium has joined #pypy
<fijal> plan_rich_: works on py2?
<plan_rich_> fijal yes but was some time ago that i tested on python 2
<fijal> k
pilne has joined #pypy
Tiberium has quit [Remote host closed the connection]
Tiberium has joined #pypy
Samureus has joined #pypy
gsnedders has quit [Quit: leaving]
gsnedders has joined #pypy
masoug has joined #pypy
jcea has quit [Quit: jcea]
amaury has quit [Ping timeout: 240 seconds]
Samureus has quit [Quit: Leaving]
oberstet has quit [Remote host closed the connection]
antocuni has quit [Ping timeout: 258 seconds]
vkirilichev has joined #pypy
cstratak has quit [Quit: Leaving]
amaury has joined #pypy
o11c is now known as o11c|vacation
yuyichao_ has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
cerealized has joined #pypy
masoug has left #pypy [#pypy]
masoug has joined #pypy
adamholmberg has quit [Ping timeout: 272 seconds]
masoug has left #pypy [#pypy]
<kenaan> rlamy PyBuffer-backport 5ea0ac27cf69 /pypy/module/: Allow memoryviews in compile() and _codecs.unicode_internal_decode()
kipras`away is now known as kipras
vkirilichev has quit [Remote host closed the connection]
rmesta has joined #pypy
rmesta has left #pypy [#pypy]
<kenaan> rlamy default 13b0394c4ce9 /pypy/doc/whatsnew-head.rst: Document merged branch
ramonvg has joined #pypy
vkirilichev has joined #pypy
vkirilichev has quit [Ping timeout: 240 seconds]
Tiberium has quit [Remote host closed the connection]
cerealized has quit [Quit: cerealized]
cerealized has joined #pypy
<kenaan> rlamy py3.5 f539c4765bcd /: hg merge default
vkirilichev has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
black_ant has quit [Ping timeout: 260 seconds]
adamholmberg has quit [Ping timeout: 255 seconds]
adamholmberg has joined #pypy
black_ant has joined #pypy
black_ant has quit [Ping timeout: 240 seconds]
black_ant has joined #pypy
nimaje is now known as Guest16174
Guest16174 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
nimaje has joined #pypy
vkirilichev has quit [Remote host closed the connection]
vkirilichev has joined #pypy
ramonvg has quit [Remote host closed the connection]
<dstufft> Is there a benefit to CFFI API mode over ABI mode in terms of performance?
ronan has quit [Ping timeout: 264 seconds]
antocuni has joined #pypy
ronan has joined #pypy
inhahe_ has quit []
<kenaan> antocuni faster-rstruct-2 3c31e7d36cc9 /rpython/jit/metainterp/: fix bhimpl_gc_store_indexed_i, which was not tested because the blackhole didn't see the op :(
<kenaan> antocuni faster-rstruct-2 f99d6f69a91c /rpython/rlib/mutbuffer.py: unroll the loop if count is a small constant
antocuni has quit [Ping timeout: 240 seconds]
rmesta has joined #pypy
rmesta has quit [Client Quit]
rmesta has joined #pypy
rmesta has quit [Client Quit]
rmesta has joined #pypy
rmesta has quit [Client Quit]
rmesta has joined #pypy
rmesta has quit [Client Quit]
<njs> dstufft: I've never tried it myself, but when other people have asked that they got told "yes"