Winch seems to be quite a bit slower than Wasmer's singlepass compiler at least on some programs, see https://github.com/zellij-org/zellij/pull/3349#discussion_r1616170661 and the linked wasmi blog post. Is this just having that everyone has only worked on getting it correct before thinking about optimizing it or are there fundamental reasons it is so much slower?
clarification: slower at compiling code or produces slower code?
either way, I think the answer is that effort has been going into correctness and completeness, not compile times or code quality (and we would want to be very careful about introducing code improvements, this is very intentionally not an optimizing compiler, see for example: https://www.wingolog.org/archives/2020/03/25/firefoxs-low-latency-webassembly-compiler)
Slower at compiling code.
gotcha. yeah I think the answer is just that no one has even started profiling and improving it yet, just focused on correctness and completeness. definitely something we plan to do, just haven't gotten there yet.
also cc @Saúl Cabrera
Yeah, agreed with Nick. I have worked on a couple of optimizations for very specific, internal use-cases, but it's still in my todo to hook Winch to Sightglass in order to profile more generally and improve the compilation performance where possible. I don't know much about that other single pass compiler, but I don't think there's a fundamental reason for that performance difference.
Last updated: Nov 22 2024 at 17:03 UTC