<amstan>
i tried declaring a buffer of the fished length, then casting it to a "struct mystruct*"
<amstan>
my non array fields seem fine (when i update them, the data in my buffer updates too), but my array seems to be stored somewhere completelly different
gbutnaru has quit [Quit: Leaving]
<o11c>
amstan: write it as a flexarr instead
tilgovi has quit [Remote host closed the connection]
<o11c>
>>> ffi.cdef('struct Bar { int head; char len[]; };')
<o11c>
>>> ffi.new('struct Bar *', (3, b'abc'))
tilgovi has joined #pypy
<o11c>
(wow I messed those variable names up)
realitix has joined #pypy
<amstan>
o11c: hmm, pretty good
<amstan>
o11c: hmm, it seems to be overallocating a little bit
<amstan>
for example, assuming the sizeof the int for "head" is for, the size of the whole thing would be 8
<John>
if i say "the difference between pypy and C is negligible (roughly 2x slower), and often PyPy will be faster than Java"
<John>
Is that a bold-faced lie? :P
<John>
Because i don't feel it is.
<LarstiQ>
it really depends on what you're doing
<John>
re-writing shitty C++ programs into Python
<John>
or shitty Java programs
pilne has quit [Client Quit]
<John>
I mean, from empirical evidence, i write much faster programs that do the same thing as a Java program, in pypy. every time.
<LarstiQ>
John: well add "in my experience" and it won't be a lie? ;)
<John>
But its mainly because i notice shortcuts and things that the Java guy didnt. but is that a function of PyPy's? I believe it to be, because i wouldnt have seen the shortcut if i was worrying about types and stuff
<John>
Yeah, hehe, i've been doing that for like, this whole section i'm writing, so i was hoping i could leave out the qualifier this one time
<John>
but i guess it wouldnt be science if i wrote it in plain english that people would easily understand what im getting at -_-
amaury has joined #pypy
tilgovi has quit [Quit: No Ping reply in 180 seconds.]
tilgovi has joined #pypy
jamadden has joined #pypy
jamadden has quit [Client Quit]
phlebas has quit []
jamadden has joined #pypy
phlebas has joined #pypy
jamadden has quit [Client Quit]
amaury has quit [Ping timeout: 240 seconds]
jeroud has quit []
jeroud has joined #pypy
John has left #pypy [#pypy]
antocuni has quit [Ping timeout: 260 seconds]
arigato has quit [Read error: Connection reset by peer]
samth has quit []
samth has joined #pypy
jamadden has joined #pypy
tilgovi has quit [Quit: No Ping reply in 180 seconds.]
tilgovi has joined #pypy
jcea has joined #pypy
<gsnedder1>
was there not someone working on a JVM in RPython at some point?
gsnedder1 is now known as gsnedders
ssbr has quit [Ping timeout: 258 seconds]
ssbr has joined #pypy
amaury has joined #pypy
tilgovi has quit [Quit: No Ping reply in 180 seconds.]
Tiberium has quit [Remote host closed the connection]
Tiberium has joined #pypy
John has joined #pypy
<John>
hi all
Tiberium has quit [Remote host closed the connection]
<John>
i appreciate that pypy can improve performance by typing, and in some instances remove operations that are not required
Tiberium has joined #pypy
<John>
but can it detect the usage of some algorithm, such as a merge sort, and replace it with another, such as a quick sort?
Tiberium has quit [Remote host closed the connection]
<LarstiQ>
John: that's not how it works
<John>
right
<LarstiQ>
and, as a layperson, that seems a rather hairy research topic in general
<John>
right
<LarstiQ>
John: have you read the jit papers?
<John>
no, none. to be honest they're beyond me
<LarstiQ>
how do you know if you did not read them? ;P
<John>
heheh, good point :)
<John>
Well i'm jut trying to convey the jist of what PyPy does to a lay person
<John>
Actually im trying to convey how programs can be optimised by a developer, but that optimisation usually comes at the cost of readability
Tiberium has joined #pypy
<John>
however PyPy gives one the benefits of simple code whilst also being fast
<John>
By "essentially detecting unessecary operations are re-writing the code to avoid performing them"
<John>
Operations being op code
<John>
Oh, i quoted myself wrong. I also mention that it occurs while the code is running
<John>
regardless, my next topic on optimising programs is using a different algorithm that achieves the same result. And i say that JIT compilers aren't capable of doing such large changes.
<John>
But i just wanted to make sure i'm not wrong there, and PyPy doesnt, in fact, also replace one kind of sort with another, or similar
<Alex_Gaynor>
I don't know anything about your application, but if you can make version immutable or quassiimutable you can remove the getfield and guard_valu
<Alex_Gaynor>
e
<Cheery>
~:|
<Cheery>
Alex_Gaynor: those other guards may result from that guard?
<Cheery>
overall I guess some of them are just from the branching.