Get the latest tech news

Optimizing the Ion compiler back end


In September, machine learning engineers at Mozilla filed a bug report indicating that Firefox was consuming excessive memory and CPU resources while running Microsoft’s ONNX Runtime (a machine learning library) compiled to WebAssembly.

When I was discussing this with Julian Seward, he pointed out that Chris Fallin also moved away from linked lists to vectors in Cranelift’s port of Ion’s register allocator. This change from sorted linked lists to optionally-sorted vectors made Ion compilation of this Wasm module about 20 times faster, down to 14 seconds. For the largest function in the ONNX Wasm module, this used a lot of memory: 199477 virtual registers x 132856 basic blocks is at least 3.1 GB just for these bit sets!

Get the Android app

Or read this on Hacker News

Read more on:

Photo of end

end

Photo of Ion compiler

Ion compiler

Related news:

News photo

Making the Python back end for my new webapp

News photo

Productivity suites, Exchange servers in path of Microsoft's end-of-support wave

News photo

The Doctor Behind the ‘Suicide Pod’ Wants AI to Assist at the End of Life