[Mono-dev] Long execution time on first execution (in AOT case)

Martin Däumler mdae at cs.tu-chemnitz.de
Fri Jul 9 03:06:51 EDT 2010


On 08.06.10 16:58, Martin Däumler wrote:

> thanks for your answer. That is a possible solution, but I want to use
> as much infrastructure of Mono as possible. So, I decided to do a kind
> of pre-compilation like it was intended do be done by
> "mono_precompile_assemblies()" (mono/mini/driver.c)?!
>
> So I use a lot of AOT-code to pre-compile all referenced assemblies,
> maybe in combination with the tool "monolinker" in order to reduce
> overhead. While pre-compilation, the compiled code is inserted into
> a mono-internal cache by "mono_jit_compile_method_inner()"
> (mono/mini/mini.c). While executing the assembly, the pre-compiled
> code is already in the cache and JIT-compilation is avoided.
>
> Unfortunately, there is a problem with icall-wrappers. I adapted the
> code from "add_wrappers()" (mono/mini/aot-compiler.c) to use it in my
> own pre-compilation code. This line:
>
> g_hash_table_foreach (mono_get_jit_icall_info
> (),add_jit_icall_wrapper,acfg);
>
> is used to AOT-compile icall-wrappers. Icall-wrappers that are now
> pre-compiled in scope of that code are not inserted into the
> mono-internal hash correctly.


Hello,


I solved that problem in the meantime. In method
"mono_icall_get_wrapper_full()" (mono/mini/mini.c), I call
"mono_compile_method()" in order to pre-compile an icall-wrapper.

Now, I want to do some quality tests. That is, I want to test if
the JIT compiler is needed to execute an assembly, which C# keywords
etc. are covered. I want to annotate the method(s) in question so
that there is an output if the JIT compiler is needed.

So, my question is: Is the method "mini_method_compile()" the only
place in Mono that triggers the JIT compiler on that level? Is there
way to trigger the JIT compiler that does not use the method
"mini_method_compile()"?


With kind regards,
Martin Däumler


More information about the Mono-devel-list mailing list