Hello! I noticed that when I create a module, the first function that I compile into it takes significantly longer than the following functions. Is there some initialization cost to the first time you use a module to compile a function?
There shouldn't be any initialization for Module. If you are clearing and reusing the Function/Context between multiple defines rather than creating a new one from scratch, it is possible however that the difference is caused by memory allocations cached in the Function/Context.
bjorn3 said:
There shouldn't be any initialization for Module. If you are clearing and reusing the Function/Context between multiple defines rather than creating a new one from scratch, it is possible however that the difference is caused by memory allocations cached in the Function/Context.
Makes sense! Are there any benches out there on compile speed?
not for specifically cranelift in an independent context, but we use Sightglass for benchmarking Wasmtime's compilation which uses Cranelift by default: https://github.com/bytecodealliance/sightglass
Last updated: Dec 23 2024 at 12:05 UTC