commit | b5d577689ee48a52fb8f2e5623948821950143f6 | [log] [tgz] |
---|---|---|
author | Ali K. Zadeh <alikz@google.com> | Mon May 09 17:47:32 2022 +0000 |
committer | Ali K. Zadeh <alikz@google.com> | Mon May 09 18:16:52 2022 +0000 |
tree | 26a989181b92e9f3804d75b7278f86af5daf6609 | |
parent | 2f3e92445745ed6e9914bf5efdf16892dd7df150 [diff] |
Made changes to GoogSensorMotion::QuerySensorEventsBetweenTimestamps function to have less calls to std::vector::push_back_slow_path The function now pre-allocates the vectors event_timestamps, motion_vector_x, motion_vector_y, motion_vector_z, event_arrival_timestamps (with making calls to vector::reserve), in order to avoid multiple calls to push_back_slow_path. Bug: 231138713 Test: Profiling test done, and the function is no longer showing up here: https://pprof.corp.google.com/?id=e0980f27db83f9cb0cba5b8ae5d3b73b&tab=flame&pivot=push_back_slow_path Change-Id: I481771aa1db0fb4d145e91a305582a30d48e8e48