Stream: git-wasmtime

Topic: wasmtime / issue #5237 Troubleshooting slow Cranelift com...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2022 at 19:35):

tmngo opened issue #5237:

Original Zulip topic

Based on the above Zulip topic, I made this issue and attached the generated CLIF.

I'm using Cranelift as a backend for a language I'm working on. I also have an LLVM backend (via Inkwell). While messing around with some test code, I noticed that for a very large function (10000+ lines), my Cranelift backend takes longer (~4.0s) to generate code than my LLVM backend (~1.5s). Here's my crude test case source, which continues on for about 10000 lines.

![Screenshot 2022-11-09 032154](https://user-images.githubusercontent.com/40331937/200924038-deab1c9f-362f-4f10-b9fb-314cd37626e0.png)

define_function main: 3.4641968s
======== ========  ==================================
   Total     Self  Pass
-------- --------  ----------------------------------
   1.090    0.696  Verify Cranelift IR
   0.314    0.314  Verify CPU flags
   6.916    0.161  Compilation passes
   0.040    0.040  Control flow graph
   0.060    0.060  Dominator tree
   0.000    0.000  Remove unreachable blocks
   0.009    0.009  Remove constant phi-nodes
   0.466    0.466  VCode lowering
   0.225    0.225  VCode emission
   0.001    0.001  VCode emission finalization
   1.487    1.487  Register allocation
======== ========  ==================================

clif.zip

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2022 at 19:51):

cfallin commented on issue #5237:

@tmngo we can definitely look into this; we have some long-running efforts to find ways to speed things up. One quick thing I would note though is that you have the verifier enabled. You can disable that (the Cranelift setting is enable_verifier) for a bit of a speedup.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 09 2022 at 19:55):

tmngo commented on issue #5237:

Thanks! That definitely closes the gap a decent amount.


Last updated: Nov 22 2024 at 16:03 UTC