Commit 3826c6e3 authored by Stephen D's avatar Stephen D
Browse files

Decreased RAM requirements

parent f2e5733b
# Rustic Roads
This is a basic clone of OSRM, written in rust. It is very WIP and very experimental.
This is routing engine designed for *.osm.pbf files, written in rust. It is very WIP and very experimental.
## TODO
- More API endpoints
- Take intersections into account when calculating time
- Better road speed defaults
- Lower RAM usage
## Usage
......@@ -14,7 +15,7 @@ You will need a *.osm.pbf file to import. We can use New Brunswick's:
`wget http://download.geofabrik.de/north-america/canada/new-brunswick-latest.osm.pbf`
Next, we will convert it into a graph and tree. This uses a lot of RAM(~10GB) but you can use a large swap file if you don't have enough free memory.
Next, we will convert it into a graph and tree. This uses a decent amount of RAM, especially for larger files, but you can use a large swap file if you don't have enough free memory.
`cargo run --release -- preprocess new-brunswick-latest.osm.pbf`
......@@ -33,6 +34,6 @@ Now, you can POST `http://localhost:3030/v1/table` with a body like the followin
Coordinate order is [lat, lon]. This will return an array of times in milliseconds.
# Performance
## Performance
My Ryzen 2700X is able to process 20,000 dests in 1.5 seconds on a single core. Two dests take around 13ms.
\ No newline at end of file
......@@ -121,7 +121,6 @@ pub fn preprocess(filename: &str) {
println!("Done. Generating graph...");
for e in edges {
println!("{}", e.weight);
input_graph.add_edge(e.start_node, e.end_node, e.weight);
if e.two_way {
input_graph.add_edge(e.end_node, e.start_node, e.weight);
......@@ -131,7 +130,7 @@ pub fn preprocess(filename: &str) {
println!("Freezing graph...");
input_graph.freeze();
println!("Calculating optimized graph...");
let fast_graph = fast_paths::prepare_with_params(&input_graph, &fast_paths::Params::new(10.0));
let fast_graph = fast_paths::prepare(&input_graph);
println!("Done.\r\nSaving graph...\t");
fast_paths::save_to_disk(&fast_graph, format!("{}.ff", filename).as_ref()).unwrap();
println!("Done.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment