Stream: cranelift

Topic: Module initialization time?


view this post on Zulip marin (Dec 02 2024 at 10:31):

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?

view this post on Zulip bjorn3 (Dec 02 2024 at 13:13):

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.

view this post on Zulip marin (Dec 03 2024 at 21:23):

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?

view this post on Zulip fitzgen (he/him) (Dec 04 2024 at 18:14):

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

A benchmark suite and tool to compare different implementations of the same primitives. - bytecodealliance/sightglass

Last updated: Dec 23 2024 at 12:05 UTC