Speed up plotter flatbuffer parsing
We had been lazily doing all the reflection work on every single
message. Do the work to look up the field metadata and the such only once
prior to iterating over all the messages.
Change-Id: I2bdcfdd6f71b819b162c1e602a99aedfb6924f02
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/y2020/control_loops/superstructure/turret_plotter.ts b/y2020/control_loops/superstructure/turret_plotter.ts
index 34279ba..488aed9 100644
--- a/y2020/control_loops/superstructure/turret_plotter.ts
+++ b/y2020/control_loops/superstructure/turret_plotter.ts
@@ -7,6 +7,7 @@
import {Point} from 'org_frc971/aos/network/www/plotter';
import {Table} from 'org_frc971/aos/network/www/reflection';
import {ByteBuffer} from 'org_frc971/external/com_github_google_flatbuffers/ts/byte-buffer';
+import {Long} from 'org_frc971/external/com_github_google_flatbuffers/ts/long';
import Connection = proxy.Connection;
import Schema = configuration.reflection.Schema;
@@ -19,7 +20,7 @@
constructor(private readonly schema: Schema) {
super(schema);
}
- private readScalar(table: Table, fieldName: string): number {
+ private readScalar(table: Table, fieldName: string): number|Long|null {
return this.parser.readScalar(table, fieldName);
}