| 1 | #!/usr/bin/env python2
 | 
| 2 | """
 | 
| 3 | osh_runtime.py
 | 
| 4 | 
 | 
| 5 | Extract and merge results from benchmarks/osh-runtime.sh test-oils-run
 | 
| 6 | 
 | 
| 7 | Structure:
 | 
| 8 | 
 | 
| 9 |   http://travis-ci.oilshell.org/uuu/osh-runtime/
 | 
| 10 |     git-96d96a16/
 | 
| 11 |       2024-05-08__16-11-59.andy-VirtualBox.wwz/
 | 
| 12 |         osh-runtime/
 | 
| 13 |           raw/
 | 
| 14 |             times.tsv
 | 
| 15 |             provenance.tsv
 | 
| 16 | 
 | 
| 17 |       2024-05-08__...
 | 
| 18 | 
 | 
| 19 |     git-1a.../
 | 
| 20 |       ...
 | 
| 21 |   
 | 
| 22 | Steps:
 | 
| 23 | 
 | 
| 24 | 1. Use zipfile module to extract TSV
 | 
| 25 | 2. Merge times.tsv and provenance.tsv
 | 
| 26 |    - clean up sh_path issue -- use sh_label
 | 
| 27 | 3. Concatenate all them into one TSV
 | 
| 28 |    - devtools/tsv_concat.py
 | 
| 29 | 
 | 
| 30 | Optionally use web/table/tsv2html 
 | 
| 31 | 
 | 
| 32 | But really we want a web spreadsheet that will load this big denormalized file.
 | 
| 33 | 
 | 
| 34 | Then we want to
 | 
| 35 | 
 | 
| 36 | - Select say 5 rows for LEFT
 | 
| 37 | - Select say 5 rows for RIGHT
 | 
| 38 | 
 | 
| 39 | Average the times, maybe throw out outliers
 | 
| 40 | 
 | 
| 41 | Then show diff as VERTICAL table.
 | 
| 42 | 
 | 
| 43 | Dimensions that can be compared:
 | 
| 44 | 
 | 
| 45 | - bash vs. osh, or bash vs. dash
 | 
| 46 | - osh version 1 vs. 2
 | 
| 47 | - machine 1 vs. machine 2
 | 
| 48 | - Linux vs OS X
 | 
| 49 | """
 | 
| 50 | from __future__ import print_function
 | 
| 51 | 
 | 
| 52 | import sys
 | 
| 53 | 
 | 
| 54 | 
 | 
| 55 | def main(argv):
 | 
| 56 |     print('Hello from osh_runtime.py')
 | 
| 57 | 
 | 
| 58 | 
 | 
| 59 | if __name__ == '__main__':
 | 
| 60 |     try:
 | 
| 61 |         main(sys.argv)
 | 
| 62 |     except RuntimeError as e:
 | 
| 63 |         print('FATAL: %s' % e, file=sys.stderr)
 | 
| 64 |         sys.exit(1)
 |