Re: [pypy-dev] Specialization for app level types

2015-03-22 Thread Carl Friedrich Bolz
On March 22, 2015 5:56:22 PM GMT+01:00, Robert Grosse wrote: >Since lists are specialized for storing primative ints, would it be >possible to do something similar with user defined types? Assuming that >most instances of the same type will either store or not store an int >in >the same attribu

Re: [pypy-dev] Specialization for app level types

2015-03-22 Thread Robert Grosse
Since lists are specialized for storing primative ints, would it be possible to do something similar with user defined types? Assuming that most instances of the same type will either store or not store an int in the same attribute, you could optimistically specialize it initially and fallback to t

Re: [pypy-dev] Specialization for app level types

2015-03-22 Thread Carl Friedrich Bolz
Hey Timothy, PyPy has no great solution for this yet. We have played with various approaches, Armin has described some of them. The simplest one is one that I've been trying recently on the typed-cells branch: The basic idea is that for an attribute that stores an int, the attribute stores a

Re: [pypy-dev] Specialization for app level types

2015-03-21 Thread Armin Rigo
Hi Timothy, On 21 March 2015 at 01:43, Timothy Baldridge wrote: > 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): There was some experiment in the PyPy branch 'type-specialized-instances' (in 2011-2013). The

[pypy-dev] Specialization for app level types

2015-03-20 Thread Timothy Baldridge
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 JI