[benchmarks] Use gen_kernel instead of dart2js for isolate group benchmarks.
- dart2js does not run in NNBD but gen_kernel does. - Changes to dart2js to not trigger VM benchmarks to run on Golem, allowing performance differences to accumulate until the next unrelated VM change. Changes to the front end or package:vm cause a binary diff in the platform file or kernel-service snapshot and so do trigger VM benchmarks to run on Golem. - These benchmarks don't care about running dart2js in particular, just some large program. Change-Id: I85e339c32edbf9d0261081623378475fa0b9507a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270022 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Jonas Termansen <sortie@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
committed by
Commit Queue
parent
4ba2fdc0fe
commit
edaaa70e31
@@ -8,7 +8,7 @@ import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:compiler/src/dart2js.dart' as dart2js_main;
|
||||
import '../../../pkg/vm/bin/gen_kernel.dart' as gen_kernel;
|
||||
import 'package:vm_service/vm_service.dart' as vm_service;
|
||||
import 'package:vm_service/vm_service_io.dart' as vm_service_io;
|
||||
|
||||
@@ -65,7 +65,7 @@ class SpawnMemory {
|
||||
final readyRss = ProcessInfo.currentRss;
|
||||
final readyHeap = await currentHeapUsage(wsUri);
|
||||
|
||||
// Let all isolates do the dart2js compilation.
|
||||
// Let all isolates do the gen_kernel compilation.
|
||||
for (int i = 0; i < numberOfBenchmarks; i++) {
|
||||
final iterator = iterators[i];
|
||||
final continuation = continuations[i];
|
||||
@@ -116,9 +116,9 @@ Future<void> isolateCompiler(StartMessage startMessage) async {
|
||||
await iterator.moveNext();
|
||||
|
||||
await runZoned(
|
||||
() => dart2js_main.internalMain(<String>[
|
||||
'benchmarks/IsolateSpawnMemory/dart/helloworld.dart',
|
||||
'--libraries-spec=sdk/lib/libraries.json'
|
||||
() => gen_kernel.compile(<String>[
|
||||
'benchmarks/IsolateSpawn/dart/helloworld.dart',
|
||||
'benchmarks/IsolateSpawn/dart/helloworld.dart.dill',
|
||||
]),
|
||||
zoneSpecification: ZoneSpecification(
|
||||
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {}));
|
||||
@@ -138,7 +138,7 @@ Future<int> currentHeapUsage(String wsUri) async {
|
||||
int sum = 0;
|
||||
for (final groupId in groupIds) {
|
||||
final usage = await vmService.getIsolateGroupMemoryUsage(groupId);
|
||||
sum += usage.heapUsage + usage.externalUsage;
|
||||
sum += usage.heapUsage! + usage.externalUsage!;
|
||||
}
|
||||
vmService.dispose();
|
||||
return sum;
|
||||
@@ -161,12 +161,12 @@ Future<void> main() async {
|
||||
Future<List<String>> getGroupIds(vm_service.VmService vmService) async {
|
||||
final groupIds = <String>{};
|
||||
final vm = await vmService.getVM();
|
||||
for (final groupRef in vm.isolateGroups) {
|
||||
final group = await vmService.getIsolateGroup(groupRef.id);
|
||||
for (final isolateRef in group.isolates) {
|
||||
final isolateOrSentinel = await vmService.getIsolate(isolateRef.id);
|
||||
for (final groupRef in vm.isolateGroups!) {
|
||||
final group = await vmService.getIsolateGroup(groupRef.id!);
|
||||
for (final isolateRef in group.isolates!) {
|
||||
final isolateOrSentinel = await vmService.getIsolate(isolateRef.id!);
|
||||
if (isolateOrSentinel is vm_service.Isolate) {
|
||||
groupIds.add(groupRef.id);
|
||||
groupIds.add(groupRef.id!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user