[pypy-dev] Specialization for app level types

Carl Friedrich Bolz cfbolz at gmx.de
Sun Mar 22 18:51:52 CET 2015



On March 22, 2015 5:56:22 PM GMT+01:00, Robert Grosse <n210241048576 at gmail.com> 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 attribute, you could optimistically specialize it initially
>and
>fallback to the normal code if this invariant is broken.

Hi Robert, 

Note that the whole thread *is* about user defined types. The specialization you describe is possible, but entirely non-trivial, with various trade offs involved. This paper describes an approach to solve it:

http://www.chrisseaton.com/rubytruffle/pppj14-om/pppj14-om.pdf

Cheers, 

Carl Friedrich 


More information about the pypy-dev mailing list