[pypy-dev] Differences between app and interp level calling methods

Timothy Baldridge tbaldridge at gmail.com
Fri May 25 22:48:26 CEST 2012


For my clojure module, I'm trying to figure out if I should go with
app level or interp level code. Many of my classes will do dispatching
on __call__ or the equivalent. Are interpreter level variadic
functions going to be faster (via call_args) vs an app level
__call__(self, args_w) ?

A bit more background here, Clojure functions dispatch on the number
of arguments:

(defn +
    [x] x
    [x y] (add x y))
    [x y & rest] (reduce + (add x y) rest))


For something like this, am I going to see much of a performance boost
by dropping to the interpreter level from the dispatch between these
three sub-function types?

Thanks,

Timothy



-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)


More information about the pypy-dev mailing list