Repository navigation
tests: cache compiled cobolrt/CICS runtimes per worker and speed up closure/AST scans - #5247
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Speeds up five high-leverage test bottlenecks (~1,990s of
.test_durationsCPU time across the suite) without changing or weakening any test assertion:tests/cobol_mainframe/test_det_nondigit_binary.py(_det, called 311x bytest_det_nondigit_zoned.py)cobolrt/*.java+CobolRecords.javaruntime classes once per worker process (_runtime_classes()) and passes-cp <rt_classes>tojavac/javaso each test only compiles its generated service andMain.java(~3.2s->~0.55sper test across 311 cases).tests/cics_crucible/test_cics_runtimes.py(_stuband_cics_task, 206 tests / 548.8s)tests/equivalence/cics/ggcics.conce per worker toggcics.o(_stub_obj()) and caches linked C stub binaries bymainsource (_compiled_stub()).CicsTask.java+CicsSpec.javaonce per worker (_cics_task_classes()) while still writingCicsTask.javatotmp_path/src/t/cics/for source-inspection assertions, compiling onlyMain.javaper test.tests/cobol_mainframe/test_det_programs.py(_java_runand_java_run_batch)cobolrt+CobolRecordsruntime classes once per(batch, charset)per worker (_runtime_classes()), speeding uptest_det_programs.py,test_lifted_binary_trunc.py,test_trunc_opt.py, and 7 sibling modules (test_all_literal_relation_emits_compilable_javadrops from13.33s->1.92s;test_trunc_opt.py+test_lifted_binary_trunc.pydrop from172.4s->19.4s).tests/tools/test_ground_truth_plan.py(_closure)re.compile(r"\w+").findall(...)and intersects withmods.keys()instead of running 120 separatere.search(rf"\b{re.escape(m)}\b", text)scans per file (13.97s->0.13s, 107x faster).tests/cobol_mainframe/test_java_subprocess_utf8.py(_java_callsand_maven_calls)ast.parse(source)on files that do not contain"subprocess"/".tool"+"java"(or"subprocess"+"mvn"), cutting the 600-file AST scan from3.71s->1.11slocally (19.73s->~2son CI).Verification
tests/tools/box/heavy-run.sh python tests/tools/pr_gates.py --fast(6/6 gates pass)pytest tests/tools/test_ground_truth_plan.py tests/cobol_mainframe/test_java_subprocess_utf8.py tests/cobol_mainframe/test_trunc_opt.py tests/cobol_mainframe/test_lifted_binary_trunc.py tests/cobol_mainframe/test_det_programs.py tests/cobol_mainframe/test_det_nondigit_binary.py