cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | hacking on TLS is fun, way more fun than arguing over petty shit, turns out
Atque has joined #pypy
slav0nic has quit [Ping timeout: 252 seconds]
Atque has quit [Remote host closed the connection]
Atque has joined #pypy
luckydonald has quit [*.net *.split]
lastmikoi has quit [*.net *.split]
Dejan has quit [*.net *.split]
dmalcolm has quit [*.net *.split]
samth has quit [*.net *.split]
Corbin has quit [*.net *.split]
lesshaste has quit [*.net *.split]
[Arfrever] has quit [*.net *.split]
xcm_ has quit [*.net *.split]
atomizer_ has quit [*.net *.split]
iwkse has quit [*.net *.split]
mgorny has quit [*.net *.split]
arigo has quit [*.net *.split]
energizer has quit [*.net *.split]
antocuni has quit [*.net *.split]
benjamin has quit [*.net *.split]
luckydonald has joined #pypy
lesshaste has joined #pypy
antocuni has joined #pypy
Dejan has joined #pypy
lastmikoi has joined #pypy
[Arfrever] has joined #pypy
Corbin has joined #pypy
xcm_ has joined #pypy
benjamin has joined #pypy
atomizer_ has joined #pypy
samth has joined #pypy
dmalcolm has joined #pypy
mgorny has joined #pypy
iwkse has joined #pypy
arigo has joined #pypy
energizer has joined #pypy
tazle has quit [Ping timeout: 256 seconds]
tazle has joined #pypy
jstoker has quit [*.net *.split]
LarstiQ has quit [*.net *.split]
LarstiQ has joined #pypy
LarstiQ has quit [Changing host]
LarstiQ has joined #pypy
jstoker has joined #pypy
_whitelogger has joined #pypy
tumbleweed has joined #pypy
graingert[m] has joined #pypy
otisolsen70 has joined #pypy
otisolsen70 has quit [Quit: Leaving]
jacob22 has quit [Ping timeout: 256 seconds]
glyph has quit [Quit: End of line.]
glyph has joined #pypy
otisolsen70 has joined #pypy
jacob22 has joined #pypy
Atque has quit [Quit: ...]
otisolsen70 has quit [Quit: Leaving]
x88x88x has joined #pypy
x88x88x- has joined #pypy
x88x88x- has quit [Ping timeout: 265 seconds]
Julian has joined #pypy
slav0nic has joined #pypy
Guest96_ has joined #pypy
marky1991 has joined #pypy
<marky1991> i'm doing some silly programming problems this year and I was testing one of my solutions with larger and larger Ns to see how it scaled
<marky1991> one thing I've found is that my latest solution has a performance cliff it falls off if I make my iteration count too large
<marky1991> if i remove the final 0 in line 13, https://hg.sr.ht/~marky1991/advent2021/browse/12.py the program runs in a second or so
<marky1991> but if i just run this as is, it takes more than 90 seconds, probably more. I killed it when I got impatient. I'll give it more time now
<marky1991> but I'm wondering why it scales soo poorly at that value, the implementation seems like it should be roughly constant time
<marky1991> i also tested it with cpython and get the same huge slowdown at the same value, so I'm guessing that there's something wrong with my algorithm
<marky1991> but I was wondering if anyone else saw what I'm doing wrong
<marky1991> feel free to ignore if it's not interesting, it's obviously not real production code anywhere, so not that important
<cfbolz> marky1991: isn't that because at some point you switch to long integers
<cfbolz> the result grows exponentially
<cfbolz> and at some point the answer doesn't fit into 64 bits any more
<marky1991> hm, it had grown to large integers before that
<marky1991> but that makes some sense
<cfbolz> ok, but it gets slower and slower to add them
<marky1991> right
<marky1991> maybe it finally went past some specific size that just kills it
<cfbolz> marky1991: maybe plot the time?
<cfbolz> marky1991: this is my code for the same problem, looks exponential as expected https://usercontent.irccloud-cdn.com/file/OgX1EavG/image.png
<marky1991> it looks like pypy is much faster than cpython for this value, so I guess that's still good
<marky1991> still waiting on cpython to finish
<marky1991> pypy took 75s wall time
<marky1991> but that's surprising, I would expect them to take roughly te same time if the problem were 8 really-big-bignums
<cfbolz> marky1991: we have different bignum implementations
<marky1991> oof, 5m for cpython
<marky1991> ah, ok
<marky1991> thanks for the explanation
<marky1991> i wonder how decimal would perform, will test
<cfbolz> decimal would only help if printing was the problem (unlikely)
<cfbolz> you could try gmpy
<marky1991> my gut feeling was that it would be slower
<cfbolz> nope, factor 4 faster for me
<cfbolz> marky1991: you should switch to using a list instead of a dict though, that helps cpython
<cfbolz> marky1991: here's my slightly weird approach, btw: https://gist.github.com/cfbolz/ee7e705c9c14517b30cf4eab5087e431
<marky1991> rurprising, my implementatoin took longer than 5m if i replaced it with decimal objects
<marky1991> ha, floats just don't work, returning a nan
<marky1991> must exceed the limit
<marky1991> interesting, very different
Julian has quit [Ping timeout: 265 seconds]
<marky1991> the index trick is very clever
<marky1991> much cheaper than my lazy dict-shuffling approach
Julian has joined #pypy
marky1991 has quit [Ping timeout: 252 seconds]
Julian has quit [Quit: leaving]
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 265 seconds]
Guest96_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Atque has joined #pypy