<div dir="ltr"><div><div>Hello Michael,<br><br></div>I recently came across a similar issue, I wanted to make OSRM requests skipping as much overhead as possible. I was making as many requests as I could on multiple threads, and eventually the local OSRM server would just hang. By integrating OSRM as a library, the performance at least doubled.<br><br> When you build OSRM, it generates libOSRM.a, which is a static library with all the OSRM code. Since my project was in C++, I could call it directly. There must be some way you can call it from R. <br><br><a href="http://pastebin.com/Dj9E7rkk">http://pastebin.com/Dj9E7rkk</a><br><br></div>This is some C++ code that calls the OSRM functions. You could make a small command line application that takes the coordinates as parameters and pass it to that. Don't worry about the http:Reply thing, there is no networking or I/O overhead involved, it will just render the json to the reply.contents.<br></div>