]> git.bitcoin.ninja Git - dnsseed-rust/commitdiff
pre-alloc routing table
authorMatt Corallo <git@bluematt.me>
Tue, 21 Jul 2020 17:34:27 +0000 (13:34 -0400)
committerMatt Corallo <git@bluematt.me>
Tue, 21 Jul 2020 17:34:27 +0000 (13:34 -0400)
src/bgp_client.rs

index 60c80cf0ad9dbfda7fe172548868e7960f61c333..5f436b1ca106f12d132952436961cd5df0db07a7 100644 (file)
@@ -84,8 +84,8 @@ struct RoutingTable {
 impl RoutingTable {
        fn new() -> Self {
                Self {
-                       v4_table: HashMap::new(),
-                       v6_table: HashMap::new(),
+                       v4_table: HashMap::with_capacity(900_000),
+                       v6_table: HashMap::with_capacity(100_000),
                }
        }