symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Move `Factor::index_entries_` to be cached by the optimizer #266

Closed aaron-skydio closed 1 year ago

aaron-skydio commented 1 year ago

We should be able to avoid that chunk of state, along with Values::Id, if we cache these in the optimizer instead of in the Factor. It means linearizing a factor outside an optimizer will never benefit from the cache unless the user caches the index entries themselves, but that's probably fine