You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With --enable-isolate-groups, when application creates more isolates than VM tlab allows(more than thread_pool capacity) contention between isolates increases:
import'dart:async';
import'dart:isolate';
longWork(List args) {
DateTime startDateTime = args[0];
SendPort sendPort = args[1];
int i =0;
while(i <10*1024*1024) {
try {
throw1;
} catch(e) {
i++;
}
}
sendPort.send(DateTime.now().difference(startDateTime).inMilliseconds);
}
quickUrgentWork(List args) {
DateTime startDateTime = args[0];
SendPort sendPort = args[1];
sendPort.send(DateTime.now().difference(startDateTime).inMilliseconds);
}
main() async {
final n =19;
final receivePorts =<ReceivePort>[];
final isolates =<Future<Isolate>>[];
for (int i =0; i < n -1; i++) {
receivePorts.add(ReceivePort());
Isolate.spawn(longWork, [DateTime.now(), receivePorts[i].sendPort]);
}
receivePorts.add(ReceivePort());
Isolate.spawn(quickUrgentWork, [DateTime.now(), receivePorts[n-1].sendPort]);
final msUrgentWorkResponse =await receivePorts[n-1].first;
print("$msUrgentWorkResponse ms");
for (int i =0; i < n; i++) {
receivePorts[i].close();
}
}
─➤ $DH/out/ReleaseX64/dart many_isolates.dart
160ms
╰─➤ $DH/out/ReleaseX64/dart --enable-isolate-groups many_isolates.dart
19045ms
╰─➤ $DH/out/ReleaseX64/dart --disable-dart-dev --verbose 2&>1 | grep new_gen_semi_max
new_gen_semi_max_size: 16 (Max size of new gen semi space in MB)
The text was updated successfully, but these errors were encountered:
aam
added
the
area-vm
Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
label
Aug 26, 2021
With
--enable-isolate-groups
, when application creates more isolates than VM tlab allows(more than thread_pool capacity) contention between isolates increases:The text was updated successfully, but these errors were encountered: