![]() This machine benchmarks at 167968 pystones/second $ docker run -v $PWD:/code fedora:33 python3.9 /code/pystone.py This machine benchmarks at 200984 pystones/second I’m going to compare running some code on my machine to code inside a container, and so for maximum realism I’m going to use the fedora:33 image.įirst, let’s test a tiny Rust program that just does some floating point calculations: The computer I’m testing on is running Fedora 33, and has Docker 20.10.6 I’ve disabled some operating system and CPU features that can make benchmarks less consistent (ASLR and turboboost). ![]() On macOS and Windows, for example, standard Linux-based Docker containers aren’t actually running directly on the OS, since the OS isn’t Linux.Īnd the image filesystem from the container itself is typically mounted with some sort of overlay filesystem, which can slow things down, so for anything I/O bound you want to use a bind-mounted volume.īut even on Linux, with seeminly CPU-only workloads, Docker can distort runtime performance. Sometimes, running under Docker can actually slow down your code and distort your performance measurements. ![]() One of the benefits of containers over virtual machines is that you get some measure of isolation without the performance overhead or distortion of virtualization.ĭocker images therefore seem like a good way to get a reproducible environment for measuring CPU performance of your code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |