jitpypyrpython

RPython jit logs


I've being working on a simple VM in RPython, translating it using Pypy to inspect JIT traces:

python ./.pypy/rpython/translator/goal/translate.py --opt=jit ${PWD}/src/awk_vm/awk_vm.py

Makefile

But when I run my translated program, I don't get anything in logs:

$ PYPYLOG=jit-log-opt:./log/awk_vm_loops.logfile ./awk_vm-c ./programs/awk/loops.awk

I can't see what I am doing differently from PyPy tutorials

Here's my PyPy tutorial code.

Any help would be appreciated :)

Updateed my git release with the artefact and the shell cmd - https://github.com/Pavel-Durov/pypy.meta.tracing/releases/tag/0.0.3


Solution

  • After trying a bunch of random things, comparing tutorials etc, i found it! My issue was that my program was too short of producing jit log.

    The initial program I ran was:

    x = {}; 
    x.a = 0;
    x.b = 4;
    while (x.a < 10) {
      x.a = x.a + x.b;
    }
    x.b = 9;
    y = {};
    y.a = x.b;
    

    When I changed the program to have more actual loops:

    ...
    while (x.a < 99999) {
      x.a = x.a + x.b;
    }
    ...
    

    I suddenly got jit logs produced!

    I'm still puzzled about why it doesn't work for short programs. The JIT is not kicking in? I need to read more about the JIt implementation :)

    But yeah, I got my jit logs!