AnyarInc / Ascent

A fast and flexible C++ simulation engine and differential equation solver.
Apache License 2.0
123 stars 15 forks source link

Recorder update() performance #11

Closed mwalcott3 closed 4 years ago

mwalcott3 commented 4 years ago

Dynamic memory allocations were happening each time a recording_function was called. Additionally having a lambda function to handle conversions is only needed when the type of the thing being recorded doesn't match the recorder type. If the types match then we can simply save a pointer and get much better performance.

Should be quite a bit faster based on results from a short Buzzard scenario Before: rec1 After: rec2