I'd like to add some optimization to app level types in Pixie. What I'm
thinking of is something like this (in app level PyPy code):


class Foo(object):
   def __init__(self, some_val):
     self._some_val = some_val
   def set_value(self, val):
     self._some_val = val

In a perfect world the JIT should be able to recognize that ._some_val is
only ever an int, and therefore store it unboxed in the instance of the
type, hopefully this would decrease pressure on the GC if ._some_val is
modified often. Also in a perfect world, the value of _some_val should be
auto promoted to an object if someone ever decides to set it to something
besides an int.

How would I go about coding this up in RPython? I can't seem to figure out
a way to do this without either bloating each instance of the type with an
array of object, an array of ints and an array of floats.

Currently app level objects in Pixie are just a wrapper around a object
array. The type then holds the lookups for name->slot_idx.

Thanks in advance.

Timothy Baldridge
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to