These are chat archives for dropbox/pyston

16th
Nov 2015
AlphaStream
@AlphaStream
Nov 16 2015 01:08
@kmod would be good to know if there's a notion of warnings in pyston. I wasn't able to locate any so far.
@kmod Also, I'm a bit confused as per where the global <name> statements are executed. ASTInterpreter::visit_globalis effectively a no-op, but the global statements do work somehow.
AlphaStream
@AlphaStream
Nov 16 2015 01:15
Thanks!
Kevin Modzelewski
@kmod
Nov 16 2015 01:56
we haven't done anything special with warnings
I don't fully know about how they work in CPython, but I think there's both some python libraries for them, and also a little bit of interpreter support
I think we have both but there might be parts missing
since I think warnings are usually off unless you specifically ask for them
Rudi Chen
@rudi-c
Nov 16 2015 04:36
Uh, so a stack overflow on a generator stack causes a SIGBUS bus error fault (which also crashes a lot of GDB features) instead of a segfault.
Took me forever to figure out that the problem was a stack overflow.
Rudi Chen
@rudi-c
Nov 16 2015 06:48
Yeah so NumPy has types inheriting from int, and the allocation causes a problem similar to that addressed in dropbox/pyston@79b2e9c
I think I need to assign tp_new to a function (not slot_tp_new) and try to match the behavior of CPython's int_new function. I hope that can be done without a performance drop, ints are allocated quite often :(
Kevin Modzelewski
@kmod
Nov 16 2015 09:48
I think most int allocations go through our fastpath (DEFAULT_CLASS_SIMPLE) so hopefully it'll be ok!
and yeah stack overflow really confuses gdb :/
Marius Wachtler
@undingen
Nov 16 2015 10:00
@lesshaste I spend 10mins seeing how much speedup I can get for your benchmark and I got it down to 26secs from 1min26 (cpython 28secs) with the following changes: undingen/pyston@5c026f8
mainly by reusing int objects for values from -100..99 instead of only 0..99 and increasing the collection threshold 10x to 100MB. I think getting this down even more should not be hard...
Marius Wachtler
@undingen
Nov 16 2015 10:08
pypy 4.0 takes 1min5
Sun
@Daetalus
Nov 16 2015 10:12
CPython seems reusing int values from -5 to 257.
Marius Wachtler
@undingen
Nov 16 2015 10:15
oh cool
Sun
@Daetalus
Nov 16 2015 10:26
And I think min < x && x < max will keep the readability. :smile:
Marius Wachtler
@undingen
Nov 16 2015 10:36
you are right but it was just a quick change with no indent to integrate it
Kevin Modzelewski
@kmod
Nov 16 2015 10:47
ooh interning the negative numbers sounds like it could be helpful in general
Marius Wachtler
@undingen
Nov 16 2015 10:57
yeah especially the small ones (I'm pretty sure -1 is showing up a lot :D)