• Jason Madden's avatar
    Compile the monitor greenlet tracer with Cython. · aa911ed0
    Jason Madden authored
    This makes things 54% faster. In fact, the monitor tracer is now faster than a trivial tracer implemented in python (settrace(lambda e, a: None)).
    
    +-------------------+-----------------+-----------------------------+
    | Benchmark         | 37_bench_tracer | 37_bench_tracer_cython_opt3 |
    +===================+=================+=============================+
    | monitor tracer    | 1.62 us         | 739 ns: 2.20x faster (-54%) |
    +-------------------+-----------------+-----------------------------+
    | max switch tracer | 3.06 us         | 874 ns: 3.50x faster (-71%) |
    +-------------------+-----------------+-----------------------------+
    | hub switch tracer | 2.16 us         | 815 ns: 2.66x faster (-62%) |
    +-------------------+-----------------+-----------------------------+
    
    Not significant (2): no tracer; trivial tracer
    aa911ed0
bench_tracer.py 2.26 KB