perf-python: overhaul the count_between script

Instead of accumulating all the events composing a record before
processing them, the events are now counted as soon as a threshold is
reached. This change significantly decreases the memory footprint and
the script execution time.
perf-python: add some comments
perf-python: overhaul latency script

Instead of accumulating all the events composing a record before
processing them, events latencies are now computed as soon as a
threshold is reached. This change significantly decreases the memory
footprint and the script execution time.