-
Notifications
You must be signed in to change notification settings - Fork 24
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
[idea] Running this on MacOS / without valgrind dependency #25
Comments
You can probably write a Dockerfile to install valgrind and run the bench suite inside the container. Then launch it with a shell script. Seems pretty straightforward. https://www.gungorbudak.com/blog/2018/06/13/memory-leak-testing-with-valgrind-on-macos-using-docker-containers/ |
Another alternative: Install a fork of |
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. To do: * [ ] Look for a maintained alternative. * [ ] Write macros to remove duplication in benchmarks. * [ ] Document how to run iai benchmarks. * [ ] Add CI report from iai run? [iai]: https://github.com/bheisler/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. To do: * [ ] Look for a maintained alternative. * [ ] Write macros to remove duplication in benchmarks. * [ ] Document how to run iai benchmarks. * [ ] Add CI report from iai run? [iai]: https://github.com/bheisler/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25
Unfortunately valgrind-macos seems to give results that are all over the place. Each run returns different numbers, whereas in a Docker container it seems to always return the same numbers until I change the code. For people who are curious, there are two ways to use this crate on macOS once you’ve installed
|
It seems dynamic linker startup is quite noisy. I created #26 which makes things a lot more stable for me. |
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile and a docker.sh script to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. To do: * [x] Look for a maintained alternative. * [ ] Write macros to remove duplication in benchmarks. * [x] Document how to run iai benchmarks. * [ ] Add CI report from iai run? [iai]: https://github.com/bheisler/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile and a docker.sh script to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. Some folks are working on [calliper], but it doesn’t seem to be ready yet. To do: * [x] Look for a maintained alternative. * [ ] Write macros to remove duplication in benchmarks. * [x] Document how to run iai benchmarks. * [ ] Add CI report from iai run? [iai]: https://github.com/bheisler/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25 [calliper]: https://github.com/osiewicz/calliper
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile and a docker.sh script to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. Some folks are working on [calliper], but it doesn’t seem to be ready yet. To do: * [x] Look for a maintained alternative. * [ ] Write macros to remove duplication in benchmarks. * [x] Document how to run iai benchmarks. * [ ] Add CI report from iai run? [iai]: https://github.com/bheisler/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25 [calliper]: https://github.com/osiewicz/calliper
[iai] “benchmarks” functions by counting instructions, cache hits, and memory accesses. It also estimates cycles. It uses [`valgrind`], which officially doesn’t run on macOS (though there is a [port]), and `setarch`, a Linux-only command they use to disable address space layout randomization (ASLR). See [iai #25] for more information about running on macOS. This includes a Dockerfile and a docker.sh script to provide an environment to run `valgrind`. Note that iai hasn’t been updated since February 2021. Some folks are working on [calliper], but it doesn’t seem to be ready yet. [iai]: https://crates.io/crates/iai [`valgrind`]: https://valgrind.org [port]: https://github.com/LouisBrunner/valgrind-macos [iai #25]: bheisler/iai#25 [calliper]: https://crates.io/crates/calliper
I'm thinking of ways to run this on platforms where valgrind is not easily available. My current thinking is that iai could launch a Docker container with valgrind preinstalled and run its benchmarks there, then delete the container again. Docker (and the Linux VM that comes with Docker for Mac) is already "priced in" cost in my developer experience.
I don't think it makes a ton of sense to do all of Rust development in Docker though, after all compilation is still faster on M1, and most other things work.
The text was updated successfully, but these errors were encountered: