Skip to content

Draft: implement measuring time spend on each trace

David Heidelberg requested to merge dh/piglit:replayer_timing into main

let's time the traces, so we know when change introduce noticeable slowdown.

Up-to discussion:

  • threshold, default 15%, different default or customizable?
  • currently I'm timing only the trace run, while I could eventually use existing timer for piglit task, but that would introduce imprecision.

TBD

  • integrate nicely into mako template

Example (-t 1) = 1 second is expected

$ PIGLIT_SOURCE_DIR="../" ./replayer.py  compare trace -d test /home/okias/Downloads/boxxed.trace a98348fd7a73901cae0cb6903a7ebb83 -t 1
[dump_trace_images] Info: Dumping trace /home/okias/Downloads/boxxed.trace...

...

Wrote /home/okias/Downloads/boxxed.trace-0000151648.png

OK
[check_image]
    actual: a98348fd7a73901cae0cb6903a7ebb83
  expected: a98348fd7a73901cae0cb6903a7ebb83
[check_image] Images match for:
  /home/okias/Downloads/boxxed.trace

[check_time]
    actual: 1.45
  expected: 1
[check_time] Trace took longer than 1.15.

PIGLIT: {"images": [{"image_desc": "/home/okias/Downloads/boxxed.trace", "image_ref": "a98348fd7a73901cae0cb6903a7ebb83.png", "image_render": null}], "time": [{"time": 1.4461760619997222}], "result": "fail"}
Edited by David Heidelberg

Merge request reports