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
Commit 397ea36
Browse filesBrowse the repository at this point in the historyBrowse files
Skip redundant host function registration on reload (#422)
`get_loaded_sandbox` and `unload` each called `RegisterHostModules`,
although the base snapshot already holds that registration. A
load/unload cycle made four guest calls, but only `register_handler` and
`RunHandler` are needed. In hyperlight-dev/hyperlight-bench#46,
`kvm-hyperlight-js-reload` lost 15% throughput against 0.4.0.
This change registers host functions only when a restored snapshot
records different ones than the builder supplies. It then takes a new
base snapshot, so later cycles skip registration.
`full_lifecycle/add_load_handle_unload`:
| | main | this PR |
|---|---|---|
| MSHV | 415 µs | 315 µs |
| KVM | 248 µs | 203 µs |
KVM stays about 10% slower than 0.4.0 because each guest call costs more
in Hyperlight 0.18.
Breaking: the snapshot metadata schema is now 2. Snapshots from 0.5.0
can record host functions their base never registered, so they are
rejected and must be recreated.
---------
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
0 commit comments