dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.12k stars 1.57k forks source link

Feature request: creating snapshots from isolates and spawning isolates from snapshots #20417

Open DartBot opened 10 years ago

DartBot commented 10 years ago

This issue was originally filed by @BigBen1307


As far as i know, it is currently not possible to create snapshots inside dart programmatically. It would be great to have the possibility to create snapshots from dart isolate instances. Whenever the same isolate is created with spawnUri, the snapshot could be used instead.

Possible implementation:

Uint8List cachedSnapshot;

if(cachedIsolate == null) {     Isolate.spawnUri(...).then(         (Isolate iso)         {             cachedSnapshot = iso.createSnapshot();         }     ); } else {     Isolate.spawnSnapshot(cachedSnapshot, ...); }

sgjesse commented 10 years ago

Added Area-VM, Triaged labels.

iposva-google commented 9 years ago

Personally I don't think this is a good idea. The file at the URI should already be a snapshot if necessary, but this is a library enhancement in the first place.


Removed Area-VM label. Added Area-Library, Library-Isolate labels.

DartBot commented 9 years ago

This comment was originally written by @BigBen1307


If the file at the URI would already be a snapshot, how would I load it into my currently running script?

floitschG commented 7 years ago

Reassigning to VM. The big chunk of work is VM specific.

The library team would be happy to help with the public facing APIs.