1# Profiling WebAssembly 2 3One of WebAssembly's major goals is to be quite close to native code in terms of 4performance, so typically when executing Wasm you'll be quite interested in how 5well your Wasm module is performing! From time to time you might want to dive a 6bit deeper into the performance of your Wasm, and this is where profiling comes 7into the picture. 8 9For best results, ideally you'd use hardware performance counters for your 10timing measurements. However, that requires special support from your CPU and 11operating system. Because Wasmtime is a JIT, that also requires hooks from 12Wasmtime to your platform's native profiling tools. 13 14As a result, Wasmtime support for native profiling is limited to certain 15platforms. See the following sections of this book if you're using these 16platforms: 17 18- On Linux, we support [perf](./examples-profiling-perf.md). 19 20- For Intel's x86 CPUs on Linux or Windows, we support 21 [VTune](./examples-profiling-vtune.md). 22 23- For everything else, see the cross-platform profiler below. 24 25The native profilers can measure time spent in WebAssembly guest code as well as 26time spent in the Wasmtime host and potentially even time spent in the kernel. 27This provides a comprehensive view of performance. 28 29If the native profiling tools don't work for you, Wasmtime also provides a 30[cross-platform profiler](./examples-profiling-guest.md). This profiler can only 31measure time spent in WebAssembly guest code, and its timing measurements are 32not as precise as the native profilers. However, it works on every platform that 33Wasmtime supports. 34