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
{{ message }}
Repository navigation
Add API to create a Snapshot without going through creating a VM partition #1755
Ok, I think the way to go would be to add a new builder terminator snapshot_from_file and snapshot_from_bytes, and use those to benchmark all the setup that we were measuring for the uninitialized sandbox here (maybe except for the memory allocation and memcpy, but that's not a big loss).
I'll create an issue to add this and reintroduce the new benchmarks to compensate what we loose here.
I'm not totally convinced this is a good idea, because the existence of uninitialized snapshots is kind of a nasty hack the way it is done now---I don't think there is ever a good use case for them. So, I've been thinking it might make sense to move towards needing a partition handle for snapshot creation so that we can do the initialize call inside of Snapshot::from_file.
Add API to create a Snapshot without going through creating a VM partition
I also think we don't want this. It would be really nice if we can guarantee that all snapshots have gone through VM initialization. For benchmarking, then the only thing to track are
Time to create an initialized snapshot (from binary) (this includes vm init time)
Time to create a sandbox from initialized snapshot (this includes creating vm from scratch for disk-snapshot, and possibly for in-memory snapshtos as well)
It's what we do right now, but it's really annoying and makes the snapshot representation kind of non-uniform: any code that deals with it has to go check whether it is initialised or not and treat it differently. I agree with @ludfjig that it would be really nice to change so that
[..] we can guarantee that all snapshots have gone through VM initialization
Activity
syntactically commentedon Aug 24, 2026
I'm not totally convinced this is a good idea, because the existence of uninitialized snapshots is kind of a nasty hack the way it is done now---I don't think there is ever a good use case for them. So, I've been thinking it might make sense to move towards needing a partition handle for snapshot creation so that we can do the initialize call inside of
Snapshot::from_file.yoshuawuyts commentedon Aug 24, 2026
Snapshot::from_filewould also match theSandboxBuilder::from_fileAPI discussed in #1748ludfjig commentedon Aug 24, 2026
I also think we don't want this. It would be really nice if we can guarantee that all snapshots have gone through VM initialization. For benchmarking, then the only thing to track are
jprendes commentedon Aug 24, 2026
Can do so the initializing when we create the sandbox from an uninitiated snapshot?
ludfjig commentedon Aug 24, 2026
That's what we do right now
syntactically commentedon Oct 1, 2026
It's what we do right now, but it's really annoying and makes the snapshot representation kind of non-uniform: any code that deals with it has to go check whether it is initialised or not and treat it differently. I agree with @ludfjig that it would be really nice to change so that