Skip to content

Conversation

@aapoalas
Copy link
Member

I ended up doing this absolutely on the side: I started thinking if keeping the entire Vm on the heap made sense. Avoiding copying the result, exception and reference values is an unquestionable win: These should not have any values that would be required after resuming since these are effectively "scratch space". Or at least I think that's the case :)

Turning the Vecs into Box<[T]> is is much less clear. If the Vec has zero capacity, then this is an unquestionable win as we just remove one cap: 0usize from the heap. If the Vec is empty but has non-zero capacity then this is a maybe-win: This is a dealloc of the vector's backing heap array. If the Vec is non-empty (and is not full) then this is probably a loss, as it means we dealloc the old backing heap array and realloc a new, smaller array. This is kind of unlikely to really win us any prizes.

The real question then becomes: How likely are these things?

@aapoalas aapoalas merged commit 53f1720 into main Oct 12, 2024
1 check passed
@aapoalas aapoalas deleted the perf/vm-suspend branch October 12, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants