Hi Alex, On 29 September 2014 01:31, Alex Gaynor <alex.gay...@gmail.com> wrote: > So, one solution is to simply write this loop in the interpreted language > (this is what I did for Topaz, methods such as Array#each are just some ruby > code). An alternative is to make a JitDriver for that function, see can see > this pattern in pypy/objspace/std/setobject.py
That's a strange example. Maybe fijal can explain why a jit_driver with no arguments at all is still useful. >> acc = None >> for x in range(10000): >> acc = interpret(func, wrap(x)) For this use case, I'd go with a jit_driver with the "func" as a green argument (or the function's bytecode, if there is one). Then you get one loop compiled for every "func", which is what you want here. A bientôt, Armin. _______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev