[dart-announce] Breaking Change #46754: Enable isolate group support by-default

284 views
Skip to first unread message

Martin Kustermann

unread,
Jul 30, 2021, 4:46:17 AM7/30/21
to anno...@dartlang.org
We plan on enabling isolate group support (see sdk/issues/36097) by-default. This will bring major improvements to isolate spawn latency, memory consumption and communication speed.

There will be no change in behavior, but performance characteristics might change. For almost all customers we expect this to be a big win. Though for some particular uses (e.g. running Dart VM on the server with many cores executing dart isolates in parallel) it might lead to regressions - due to isolates collaborating in garbage collections.

Please leave any questions or comments on the corresponding breaking change at sdk/issues/46754.

Martin Kustermann

unread,
Jul 30, 2021, 11:51:45 AM7/30/21
to mi...@dartlang.org, anno...@dartlang.org
> We use Aqueduct as our web server. It relies on opening several isolates in a machine with multiple cores.
> How hard should this affect us?

The performance characteristics will change as mentioned on sdk/issues/46754:
Inter isolate communication will be faster, isolates will be much faster to spawn, the base memory overhead of an additional isolate will go down significantly, hot-reload will work safely, ...

Whether you will experience any negative impact due to GC being coordinated now across isolates depends on the application. Especially on how many isolates are running in parallel (i.e. have work to do at the same time), how allocation heavy those are and if the allocated data is short lived or long lived. If data survives young generation collections but dies soon thereafter, it is possible to increase the size of the young generation via --new-gen-semi-max-size=<x MB> (depending on the parallelism you expect) - this number is right now optimized for mobile devices.

I encourage you to enable it on the master channel and try it out (pass --enable-isolate-groups to the VM).

> What does "many cores" mean? I know there have been a lot of benchmarks done, so is there a more in-depth analysis so Dart users can make an informed choice here?

See the answer above as well as on the github issue.

We have a large suite of benchmarks, but those measure almost exclusively what the VM team has focused on for a long time: Single isolate peak performance.

As part of this work on lightweight isolates, we have created more benchmarks (see in our public repository here: dart-lang/sdk/tree/master/benchmarks). Those benchmarks show roughly the numbers reported on the github issue (10x+ faster spaw latency, 10x+ lower base memory consumption, 8x faster communication). It also includes benchmarks that measure event loop responsiveness on one isolate if another isolate performs heavy allocation (where data either dies young (negligible impact) or where data survives (pause times are 10-20ms - which is the time it takes to evacuate young generation object to old space)

I will see whether I can pull the numbers from our benchmarking system and add the table on the github issue.

On Fri, Jul 30, 2021 at 2:56 PM Jonathan Rezende <jona...@jode.com.br> wrote:
We use Aqueduct as our web server. It relies on opening several isolates in a machine with multiple cores.
How hard should this affect us?


--
For more ways to connect visit https://dart.dev/community
---
To unsubscribe from this group and stop receiving emails from it, send an email to announce+u...@dartlang.org.

--
For more ways to connect visit https://dart.dev/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/04369D54-7BE0-46EB-91CE-305EC4D1D557%40jode.com.br.

Martin Kustermann

unread,
Jul 30, 2021, 12:10:28 PM7/30/21
to Mark Nordine, Dart Misc, anno...@dartlang.org
> What is the default for new-gen-semi-max-size?

You can find out via:

% dart --help --verbose 2>&1 | grep new.gen
new_gen_garbage_threshold: 90 (Grow new gen when less than this percentage is garbage.)
new_gen_growth_factor: 2 (Grow new gen by this factor.)
new_gen_semi_initial_size: 2 (Initial size of new gen semi space in MB)
new_gen_semi_max_size: 16 (Max size of new gen semi space in MB)

On Fri, Jul 30, 2021 at 6:09 PM Mark Nordine <mark.n...@gmail.com> wrote:
Thanks Martin,

What is the default for new-gen-semi-max-size?

Alexander Aprelev

unread,
Jul 30, 2021, 1:13:02 PM7/30/21
to mi...@dartlang.org, Mark Nordine, anno...@dartlang.org
> > What is the default for new-gen-semi-max-size?
> You can find out via: % dart --help --verbose 2>&1 | grep new.gen

Note that new gen semi-space max size is higher (16MB/32MB for 32-bit/64-bit architectures) for command line VM [0]  than for flutter or by default for other embedders (8MB/16MB) [1]

Note also that increasing the new semi-space max size will affect among other things performance of new space GC and number of concurrently running isolates [2].

So just be aware of those connected pieces when you start adjusting the configuration options.

Alex.

Martin Kustermann

unread,
Sep 9, 2021, 4:29:34 AM9/9/21
to mi...@dartlang.org, anno...@dartlang.org
This change has now landed, isolate group support is on by-default and will be included in the next stable release towards end of the year.

On Fri, Jul 30, 2021 at 8:41 PM Mark Nordine <mark.n...@gmail.com> wrote:
Sounds good, thx
Reply all
Reply to author
Forward
0 new messages