-
-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smaller files: don't serialize turn geometry? #94
Comments
@dabreegster I'm a bit confused here. |
The idea is to apply I haven't looked at this in a while, so before starting, it's also worth uncommenting the code in |
pub fn new(path: String, timer: &mut Timer) -> Map {
if path.starts_with(&abstutil::path_all_maps()) {
match abstutil::maybe_read_binary(path.clone(), timer) {
Ok(map) => {
let map: Map = map;
if false {
use abstutil::{prettyprint_usize, serialized_size_bytes};
println!(
"- {} roads: {} bytes",
prettyprint_usize(map.roads.len()),
prettyprint_usize(serialized_size_bytes(&map.roads))
);
println!(
"- {} lanes: {} bytes",
prettyprint_usize(map.lanes.len()),
prettyprint_usize(serialized_size_bytes(&map.lanes))
);
println!(
"- {} intersections: {} bytes",
prettyprint_usize(map.intersections.len()),
prettyprint_usize(serialized_size_bytes(&map.intersections))
);
println!(
"- {} turns: {} bytes",
prettyprint_usize(map.turns.len()),
prettyprint_usize(serialized_size_bytes(&map.turns))
);
println!(
"- {} buildings: {} bytes",
prettyprint_usize(map.buildings.len()),
prettyprint_usize(serialized_size_bytes(&map.buildings))
);
println!(
"- {} areas: {} bytes",
prettyprint_usize(map.areas.len()),
prettyprint_usize(serialized_size_bytes(&map.areas))
);
println!(
"- {} parking lots: {} bytes",
prettyprint_usize(map.parking_lots.len()),
prettyprint_usize(serialized_size_bytes(&map.parking_lots))
);
println!(
"- {} zones: {} bytes",
prettyprint_usize(map.zones.len()),
prettyprint_usize(serialized_size_bytes(&map.zones))
);
// This is the partridge in the pear tree, I suppose
println!(
"- pathfinder: {} bytes",
prettyprint_usize(serialized_size_bytes(&map.pathfinder))
);
}
return map;
}
Err(err) => {
Map::corrupt_err(path, err);
std::process::exit(1);
}
}
}
let raw: RawMap = if path.starts_with(&abstutil::path_all_raw_maps()) {
abstutil::read_binary(path, timer)
} else {
// Synthetic
abstutil::read_json(path, timer)
};
Map::create_from_raw(raw, true, timer)
} Where is the commented out code in |
Er sorry, the |
I poked at this a little and learned
|
Not sure this will work, but it's a good little exploratory project.
map_model/src/turn.rs
storesgeom: PolyLine
. Last time I used theserialized_size_bytes
stuff inmap.rs
, these polylines constituted a huge part of the binary map files. The release size is slowly growing, so it'd be nice to trim this down.Maybe we could skip serializing the PolyLine, then in
Map::new
after deserializing, go fill it in again. Should measure the impact on file sizes and initial map loading time.The text was updated successfully, but these errors were encountered: