You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current verifiers were implemented eagerly, where we read and verify every single field/element in the buffer to the root table. We would be verifying lazily if, instead, we verified fields only when accessed. This idea came up when implementing the Rust verifier and I decided against it, in part because its harder, but also to present a similar interface to C++. That said, it might be worth thinking about this for every language even if we don't currently have the bandwidth to implement it.
Pros of lazy verification:
Pay for what you use: Flatbuffers was originally built for fast random access, verifying every single field kind of defeats the point of flatbuffers for users who aren't going also read every single field / vector element.
Cons:
Result types / exceptions will propagate into users' code which might be annoying
(though correctness oriented languages like Rust are into that stuff)
Pay repeatedly for what you use (with checks on each field access)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Our current verifiers were implemented eagerly, where we read and verify every single field/element in the buffer to the root table. We would be verifying lazily if, instead, we verified fields only when accessed. This idea came up when implementing the Rust verifier and I decided against it, in part because its harder, but also to present a similar interface to C++. That said, it might be worth thinking about this for every language even if we don't currently have the bandwidth to implement it.
Pros of lazy verification:
Cons:
Beta Was this translation helpful? Give feedback.
All reactions