Use RecursiveCopyVectorTable instead
The other one started using CopyVectorTable, which was pulling vtables
from the front of the log and contents from the end, making
the deduplicated config actually bigger than when it started. Recursive
copy will repack and makes it faster.
Change-Id: I4aa2f0bf102ee13942744e485a3d53884cd2ba07
diff --git a/aos/configuration.cc b/aos/configuration.cc
index 1d39f27..d581d2c 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -735,7 +735,7 @@
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Connection>>>
destination_nodes_offset =
- aos::CopyVectorTable(c->destination_nodes(), &fbb);
+ aos::RecursiveCopyVectorTable(c->destination_nodes(), &fbb);
flatbuffers::Offset<
flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>>
@@ -782,14 +782,16 @@
}
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Map>>>
- maps_offset = aos::CopyVectorTable(config.message().maps(), &fbb);
+ maps_offset =
+ aos::RecursiveCopyVectorTable(config.message().maps(), &fbb);
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Node>>>
- nodes_offset = aos::CopyVectorTable(config.message().nodes(), &fbb);
+ nodes_offset =
+ aos::RecursiveCopyVectorTable(config.message().nodes(), &fbb);
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Application>>>
applications_offset =
- aos::CopyVectorTable(config.message().applications(), &fbb);
+ aos::RecursiveCopyVectorTable(config.message().applications(), &fbb);
// Now insert everything else in unmodified.
ConfigurationBuilder configuration_builder(fbb);