Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: tests/compiler/dart2js/serialization/model_test_helper.dart

Issue 2156033002: Split out long-running serialization test and add timings to output (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/serialization/model1_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/model_test_helper.dart
diff --git a/tests/compiler/dart2js/serialization/model_test_helper.dart b/tests/compiler/dart2js/serialization/model_test_helper.dart
index 455d9964a74168a459b17f1dde4e842f1ed3ca3e..ff9423a2fa86848216127d326231d23171f56798 100644
--- a/tests/compiler/dart2js/serialization/model_test_helper.dart
+++ b/tests/compiler/dart2js/serialization/model_test_helper.dart
@@ -31,14 +31,14 @@ main(List<String> args) {
await serializeDartCore(arguments: arguments);
if (arguments.filename != null) {
Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
- print('----------------------------------------------------------------');
- print('serialize ${entryPoint}');
- print('----------------------------------------------------------------');
- SerializationResult result = await serialize(
- entryPoint,
- memorySourceFiles: serializedData.toMemorySourceFiles(),
- resolutionInputs: serializedData.toUris(),
- dataUri: Uri.parse('memory:test.data'));
+ SerializationResult result = await measure(
+ '${entryPoint}', 'serialize', () {
+ return serialize(
+ entryPoint,
+ memorySourceFiles: serializedData.toMemorySourceFiles(),
+ resolutionInputs: serializedData.toUris(),
+ dataUri: Uri.parse('memory:test.data'));
+ });
await checkModels(entryPoint,
sourceFiles: serializedData.toMemorySourceFiles(
result.serializedData.toMemorySourceFiles()),
@@ -48,6 +48,7 @@ main(List<String> args) {
Uri entryPoint = Uri.parse('memory:main.dart');
await arguments.forEachTest(serializedData, TESTS, checkModels);
}
+ printMeasurementResults();
});
}
@@ -60,96 +61,101 @@ Future checkModels(
bool verbose: false}) async {
String testDescription = test != null ? test.name : '${entryPoint}';
String id = index != null ? '$index: ' : '';
- print('------------------------------------------------------------------');
- print('compile normal ${id}${testDescription}');
- print('------------------------------------------------------------------');
- Compiler compilerNormal = compilerFor(
- memorySourceFiles: sourceFiles,
- options: [Flags.analyzeOnly]);
- compilerNormal.resolution.retainCachesForTesting = true;
- await compilerNormal.run(entryPoint);
- compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING;
- compilerNormal.world.populate();
- compilerNormal.backend.onResolutionComplete();
- compilerNormal.deferredLoadTask.onResolutionComplete(
- compilerNormal.mainFunction);
+ String title = '${id}${testDescription}';
+ Compiler compilerNormal = await measure(
+ title, 'compile normal', () async {
+ Compiler compilerNormal = compilerFor(
+ memorySourceFiles: sourceFiles,
+ options: [Flags.analyzeOnly]);
+ compilerNormal.resolution.retainCachesForTesting = true;
+ await compilerNormal.run(entryPoint);
+ compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING;
+ compilerNormal.world.populate();
+ compilerNormal.backend.onResolutionComplete();
+ compilerNormal.deferredLoadTask.onResolutionComplete(
+ compilerNormal.mainFunction);
+ return compilerNormal;
+ });
- print('------------------------------------------------------------------');
- print('compile deserialized ${id}${testDescription}');
- print('------------------------------------------------------------------');
- Compiler compilerDeserialized = compilerFor(
- memorySourceFiles: sourceFiles,
- resolutionInputs: resolutionInputs,
- options: [Flags.analyzeOnly]);
- compilerDeserialized.resolution.retainCachesForTesting = true;
- await compilerDeserialized.run(entryPoint);
- compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING;
- compilerDeserialized.world.populate();
- compilerDeserialized.backend.onResolutionComplete();
- compilerDeserialized.deferredLoadTask.onResolutionComplete(
- compilerDeserialized.mainFunction);
+ Compiler compilerDeserialized = await measure(
+ title, 'compile deserialized', () async {
+ Compiler compilerDeserialized = compilerFor(
+ memorySourceFiles: sourceFiles,
+ resolutionInputs: resolutionInputs,
+ options: [Flags.analyzeOnly]);
+ compilerDeserialized.resolution.retainCachesForTesting = true;
+ await compilerDeserialized.run(entryPoint);
+ compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING;
+ compilerDeserialized.world.populate();
+ compilerDeserialized.backend.onResolutionComplete();
+ compilerDeserialized.deferredLoadTask.onResolutionComplete(
+ compilerDeserialized.mainFunction);
+ return compilerDeserialized;
+ });
- checkAllImpacts(
- compilerNormal, compilerDeserialized,
- verbose: verbose);
+ return measure(title, 'check models', () async {
+ checkAllImpacts(
+ compilerNormal, compilerDeserialized,
+ verbose: verbose);
- checkSets(
- compilerNormal.resolverWorld.directlyInstantiatedClasses,
- compilerDeserialized.resolverWorld.directlyInstantiatedClasses,
- "Directly instantiated classes mismatch",
- areElementsEquivalent,
- verbose: verbose);
+ checkSets(
+ compilerNormal.resolverWorld.directlyInstantiatedClasses,
+ compilerDeserialized.resolverWorld.directlyInstantiatedClasses,
+ "Directly instantiated classes mismatch",
+ areElementsEquivalent,
+ verbose: verbose);
- checkSets(
- compilerNormal.resolverWorld.instantiatedTypes,
- compilerDeserialized.resolverWorld.instantiatedTypes,
- "Instantiated types mismatch",
- areTypesEquivalent,
- verbose: verbose);
+ checkSets(
+ compilerNormal.resolverWorld.instantiatedTypes,
+ compilerDeserialized.resolverWorld.instantiatedTypes,
+ "Instantiated types mismatch",
+ areTypesEquivalent,
+ verbose: verbose);
- checkSets(
- compilerNormal.resolverWorld.isChecks,
- compilerDeserialized.resolverWorld.isChecks,
- "Is-check mismatch",
- areTypesEquivalent,
- verbose: verbose);
+ checkSets(
+ compilerNormal.resolverWorld.isChecks,
+ compilerDeserialized.resolverWorld.isChecks,
+ "Is-check mismatch",
+ areTypesEquivalent,
+ verbose: verbose);
- checkSets(
- compilerNormal.enqueuer.resolution.processedElements,
- compilerDeserialized.enqueuer.resolution.processedElements,
- "Processed element mismatch",
- areElementsEquivalent,
- onSameElement: (a, b) {
- checkElements(
- compilerNormal, compilerDeserialized, a, b, verbose: verbose);
- },
- verbose: verbose);
+ checkSets(
+ compilerNormal.enqueuer.resolution.processedElements,
+ compilerDeserialized.enqueuer.resolution.processedElements,
+ "Processed element mismatch",
+ areElementsEquivalent,
+ onSameElement: (a, b) {
+ checkElements(
+ compilerNormal, compilerDeserialized, a, b, verbose: verbose);
+ },
+ verbose: verbose);
- checkClassHierarchyNodes(
- compilerNormal,
- compilerDeserialized,
- compilerNormal.world.getClassHierarchyNode(
- compilerNormal.coreClasses.objectClass),
- compilerDeserialized.world.getClassHierarchyNode(
- compilerDeserialized.coreClasses.objectClass),
- verbose: verbose);
+ checkClassHierarchyNodes(
+ compilerNormal,
+ compilerDeserialized,
+ compilerNormal.world.getClassHierarchyNode(
+ compilerNormal.coreClasses.objectClass),
+ compilerDeserialized.world.getClassHierarchyNode(
+ compilerDeserialized.coreClasses.objectClass),
+ verbose: verbose);
- Expect.equals(compilerNormal.enabledInvokeOn,
- compilerDeserialized.enabledInvokeOn,
- "Compiler.enabledInvokeOn mismatch");
- Expect.equals(compilerNormal.enabledFunctionApply,
- compilerDeserialized.enabledFunctionApply,
- "Compiler.enabledFunctionApply mismatch");
- Expect.equals(compilerNormal.enabledRuntimeType,
- compilerDeserialized.enabledRuntimeType,
- "Compiler.enabledRuntimeType mismatch");
- Expect.equals(compilerNormal.hasIsolateSupport,
- compilerDeserialized.hasIsolateSupport,
- "Compiler.hasIsolateSupport mismatch");
- Expect.equals(
- compilerNormal.deferredLoadTask.isProgramSplit,
- compilerDeserialized.deferredLoadTask.isProgramSplit,
- "isProgramSplit mismatch");
+ Expect.equals(compilerNormal.enabledInvokeOn,
+ compilerDeserialized.enabledInvokeOn,
+ "Compiler.enabledInvokeOn mismatch");
+ Expect.equals(compilerNormal.enabledFunctionApply,
+ compilerDeserialized.enabledFunctionApply,
+ "Compiler.enabledFunctionApply mismatch");
+ Expect.equals(compilerNormal.enabledRuntimeType,
+ compilerDeserialized.enabledRuntimeType,
+ "Compiler.enabledRuntimeType mismatch");
+ Expect.equals(compilerNormal.hasIsolateSupport,
+ compilerDeserialized.hasIsolateSupport,
+ "Compiler.hasIsolateSupport mismatch");
+ Expect.equals(
+ compilerNormal.deferredLoadTask.isProgramSplit,
+ compilerDeserialized.deferredLoadTask.isProgramSplit,
+ "isProgramSplit mismatch");
+ });
}
void checkElements(
« no previous file with comments | « tests/compiler/dart2js/serialization/model1_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698