Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup performance analysis #26

Open
jbreitbart opened this issue May 24, 2020 · 1 comment
Open

Startup performance analysis #26

jbreitbart opened this issue May 24, 2020 · 1 comment
Assignees

Comments

@jbreitbart
Copy link
Collaborator

This is not a bug report, just a collection of measurements I did so they won't get lost. Overall, executing the hello_world binary takes about 131ms with uhyve compiled for release.

Running uhyve with valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes --simulate-cache=yes shows the following runtime distribuation

  • 13% is spent in the runtime linker _dl_start
  • 3% is consumed in std::rt::lang_start_internal

When only considering uhyve::main the runtime is spent almost completly (~98%) in vm::Vm::load_kernel. About 7% is used to measure the TSC and 89% is spent in memcpy, some of which are unnecessary as the content from the elf file is copied twice:

  • uhyve prepares the elf file so it can be executed in the VM
  • the elf crate copies the content of the elf file to its internal data arrays

The later part is unnecessary, as neither uhyve not the functions we use from the elf crate use these data arrays. Removing https://github.com/cole14/rust-elf/blob/master/src/lib.rs#L212-L239 save ~3-4ms with the hello_world example, probably more when running a larger binary.

uhyve_callgraph

@jbreitbart jbreitbart self-assigned this May 24, 2020
@jbreitbart
Copy link
Collaborator Author

Goblin added functions to lazy parse elf files. Maybe that can be used to improve the performance. See

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

No branches or pull requests

1 participant