nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
34 stars 19 forks source link

Possible speedup for requesting sie file #1555 #1570

Closed alexlin0 closed 1 year ago

alexlin0 commented 1 year ago

When creating the sie file there is a marker string that Trick searches for where it writes the run time allocated memory. The loop that was searching for the string was iterating one character at a time and reading from file each time. This was slow. Changed the loop to read 1Mb into memory at a time and search for the string. Handled the case where the marker string could straddle the 1Mb boundary by copying a small portion of the previous part of the file for the next search. For my one test point sie file generation dropped from 90+ seconds to 3.5 seconds.