osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Intricacies of porting OSRM to WebAssembly

Open Titou325 opened this issue 2 years ago • 4 comments

Hi!

As it stands now, OSRM is backend only, with direct bindings available in C/Node, while other can interact using the REST interface. This is very versatile and will match most use cases, but it also makes OSRM hard to embed in other runtimes or in detached frontend services.

It seems to me that a potential way of exposing faster bindings with less compatiblity issues would be to compile (probably part of) OSRM to WebAssembly. This would come with the benefit of being able to interact directly with the fast C++ API without HTTP overhead in most environments, and be able to make OSRM more easily portable.

As such, I would like to understand what could be the main intricacies / subtleties of porting the core of OSRM to WebAssembly. From the top of my head, there are already some challenges with uncoupling the file system features from the core routing engine, and there might also be a catch with the current 4GB memory limit in wasm runtimes. I guess there are more to these, and would hope to know what the effort would be and if we can possibly involve ourselves in the process of doing it.

Just as a reminder, this is an open discussion and it may be that this isn't feasible in the near future.

Thanks a lot for the hard work!

Titou325 avatar Jan 26 '23 15:01 Titou325