Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ terminates the active pool before the browser closes. Set
the complete exceptions corpus and requires identical ordered results, including
resource/teardown observations. Use `--corpus PATH` for another corpus. It writes
timings and host/corpus identities to `build/browser-worker-benchmark.json`.
Oracle validation/cache warming runs once before the timed samples and appears
separately as `reference_setup`, so a cold cache cannot bias the serial sample.

The classes console compares its bulk successful language programs through two
installed console host/worker sessions. Each run still creates its own module
Expand Down
9 changes: 8 additions & 1 deletion scripts/benchmark_browser_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT / 'runtime'))
from check_classes import check
from check_classes import cached_references, check


def main():
Expand All @@ -23,6 +23,11 @@ def main():
args = parser.parse_args()
if args.repeats < 1:
parser.error('--repeats must be positive')
reference_start = time.monotonic()
reference = cached_references(args.corpus)
if reference['summary']['fail']:
raise AssertionError(reference['summary'])
reference_seconds = round(time.monotonic() - reference_start, 3)
baseline, measurements = None, []
original = os.environ.get('POCKET_PYTHON_BROWSER_WORKERS')
try:
Expand Down Expand Up @@ -53,6 +58,8 @@ def main():
args.report.write_text(json.dumps({'schema_version': 1, 'python': platform.python_version(),
'host': platform.platform(), 'browser': report['host_version'],
'corpus_sha256': report['corpus_sha256'], 'repeats': args.repeats,
'reference_setup': {'seconds': reference_seconds, 'summary': reference['summary'],
'cache': reference['reference_cache']},
'measurements': measurements}, indent=2) + '\n', encoding='utf-8')


Expand Down