3 ms·
How would you develop an application to do offline routing like my GraphHopper road routing project? Such applications have to use the RAM or disc access provi
by karussell 13y ago
How would you develop an application to do offline routing like my GraphHopper road routing project?
Such applications have to use the RAM or disc access provided by the OS. A simple cache will not do it. Although I could imagine that JavaScript is fast enough these days you still need access to lots of memory and load several hundred MB from somewhere/disc
- doublec 13y agoYou could download the routing data into IndexedDB and use that for your file system.
- karussell 13y agoAnd you know how fast that would be? Using an ordinary DB for graph algorithms is already slowish on a powerful server ...
- doublec 13y agoIndexedDB allows direct access to the blobs like a file: https://developer.mozilla.org/en-US/docs/Web/API/FileReader https://developer.mozilla.org/en-US/docs/Web/API/FileReader
- Yoric 13y agoInteresting question. Bulk loading/saving big binary data from/to IndexedDB is basically as fast as accessing the file system. Using TypedArray or (upcoming) BinaryData, JavaScript can also manipulate binary data pretty quickly. I haven't attempted doing any serious graph processing in JavaScript, but these days, JavaScript is extremely fast at tree manipulation (much faster than OCaml, which has long been the fastest high-level language for this kind of thing), so I would imagine that it's quite suited for the task. If you are serious about this, you should come and chat on irc.mozilla.org, channel #openwebapps for instance. We'll be happy to help you get started, plus that kind of discussion is often how new features and optimizations get started.